On Sunday 01 June 2014 22:00:28 Jonathan Wakely wrote:
On 1 June 2014 21:40, Peter Dimov wrote:
The problem is, though, that all type traits do derive from mpl::true_ or mpl::false_, and I'm not sure if rewriting blank.hpp in the above manner is actually correct. Should type trait specializations always derive from mpl::true_ or mpl::false_? Will I break something if I specialize a type trait to not derive from mpl::bool_? Or is a nested ::value enough? Who knows. :-)
Anecdata: I often do tag dispatching on traits and overload a function to take either std::true_type or std::false_type, where I know the trait is guaranteed to derive from one or the other (which is true for all the standard type traits, and others that I write). It wouldn't surprise me if other people do that with mpl::true_ and mpl::false_ , relying on traits deriving from exactly those types.
I sometimes do this, including outside Boost.