Re: [Interest] Flags: Non-intrusive, type-safe bitwise operators for enums
Tobias Loew via Boost <[email protected]>
| Newsgroups | gmane.comp.lib.boost.devel |
|---|---|
| Message-ID | <[email protected]> |
I agree that the presented alternatives are shorter and cleaner, but the aim of the library is not to provide new or better syntax for of flag-like types. Its main purpose is to strengthen existing code by turning logical errors, like - using unrelated enums with bitwise operators - wrong usage of negated flags (negative-bitmasks) - accidental usage of operator && instead of operator & into compilation errors. The library does this with minimal intervention: the definition of the enums is not changed, which implies that overload-resolution, template-instantiations, APIs, ... are not affected. The additional used "boost::flags::" functions from the example are not required. (Only scoped eums in Boolean contexts require an additional operator or function invocation) _______________________________________________ Boost mailing list -- [email protected] To unsubscribe send an email to [email protected] https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/[email protected]/message/HN24RKVMGDRIITKG4KRJTKRGSV3AWFNY/