Skip to content

Conversation

@allspark
Copy link
Contributor

Hi

the first change fixes a compile error with clang 3.6.0.

the second initializes the flags to 0

@grisumbras
Copy link
Owner

While the fix for empty_t is welcome (I should have tested better before merging), I cannot accept the other change. The whole point of flags having a special constructor that takes empy_t is to make default constructor trivial thus making the type a POD. This allows some optimizations on flags (for example std::copy called on a vector of PODs may use memmove instead of iteration and copy constructors). And data member initializers make the type non-trivial.

If you remove that change, I'll be happy to merge the other one.

Upd:
I should also point out, that I understand the problem of default initializer leaving garbage inside the object. But I try to make flags as fast as it can be. The choice of leaving inner integer uninitialized will be properly documented of course.

@allspark
Copy link
Contributor Author

ah ok i understand. I removed the second commit.

grisumbras added a commit that referenced this pull request May 19, 2015
@grisumbras grisumbras merged commit feef6e8 into grisumbras:master May 19, 2015
@grisumbras
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants