On Fri, Feb 5, 2016 at 4:29 AM, Niall Douglas
On 5 Feb 2016 at 4:50, Gottlob Frege wrote:
Well, you could still pass flag::none - the function address - to flag::operator&(). But of course you could then pass any function - with the same signature - so none() might need a signature like none(some_special_type unused = 0) to prevent mistaken misuse.
Does that help?
I thought of this too (specifically some_special_type<bits set for this flag>), but I realised I was getting into metaprogramming land.
I'm sure a "perfect" typesafe bitfield can finally be implemented as of C++ 14, but I think the likely implementation should be submitted as a N-paper to WG21 as an excellent example of what needs to be fixed in the C++ language. After all, typesafe bitfields ought to in a systems programming language!
A conference talk on building one of these might be very interesting ... nudge nudge! :)
Your last nudge nudge was basically "someone should solve the thread-safe listener / observer-pattern and present it", and I've fallen for that one already, don't make me do another. You can have bitfields.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost