Boost has both enable_if and disable_if, but C++0x seems to be missing the latter. Why was it left out? Are there meta-programming facilities in C++0x that allow me to build disable_if in terms of enable_if?
Oh, I just noticed that std::enable_if is basically boost::enable_if_c, and that there is no such thing as boost::enable_if in C++0x.
At the risk of seeming stupid, just do
!expressioninstead ofexpressionin the bool template parameter inenable_ifto make it behave like adisable_if? Of course if that idea works, you could just expand on it to write a class withdisable_if-like behavior?Ok, I believe you could implement
disable_iflike this: