
On 21 Mar 2017, at 19:23, Steven Watanabe via Boost <boost@lists.boost.org> wrote:
AMDG
On 03/21/2017 10:31 AM, Роман Орлов via Boost wrote:
<snip> class eats_meat; class eats_grass; class has_tail; Then bind these types to flag identifiers typedef typed_flags<eats_meat, eats_grass, has_tail> animal;
what's wrong with struct animal { bool eats_meat : 1; bool eats_grass : 1; bool has_tail : 1; };
To me standard C bitfields fit the bill, and is what I will use as long as I do not need to do bitwise operations on the flags. For just setting and reading them, it works fine and is simple to use. Beyond that, allthough outside this topic I really wish the language had the ability to take better control of the binary representation and layout of C bitfields for binary data portability. — Bjørn