On Tue, 18 Nov 2025 at 11:15, Peter Dimov via Boost <boost@lists.boost.org> wrote:
Ruben Perez wrote:
* Do you think the approach shown above is sound? In particular, operators are in the global namespace so that they work with any enum in any namespace correctly annotated.
No, I don't think this works. The operators have to be in the enum namespace.
Why? Is it because else there wouldn't be any way for the user to opt out from the default operator== definition? I understand that's the case for Describe, but users are explicitly opting into operators with the annotation. Or is there anything else I'm missing?
In Describe, I put the operators in namespace boost::describe::operators, and the user then needs to put
using boost::describe::operators::operator==;
That was my second option, but there are a bunch of them and it ends up being verbose.
in every namespace where types are defined.
_______________________________________________ Boost mailing list -- boost@lists.boost.org To unsubscribe send an email to boost-leave@lists.boost.org https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/boost@lists.boost.org/message/6XPRNZTO...