Clever! However, IMO the `auto f` would look somewhat arbitrary to users.
I agree, it needs a better name. Jamboree has suggested `lazy`, which sounds good. Of course the name is defined by the user(unless a macro was used over top of this), they could pick anything, even a `_` could be used(not that I think it is a great idea).
I know... too bad enable_if cannot be used to disable these data member declarations.
You can use enable_if for member functions, by using a default template parameter. So you can disable `f` in your example, like this: template< bool B > struct x { typedef typename boost::mpl::if_c<B, int, unusable>::type value_type; value_type v; // unfortunately, this can't actually be disable, so make it useless. template< bool InternalBool = true, class=typename std::enable_if<InternalBool && B>::type> void f ( ) { value_type w; w = v; } }; The `InternalBool` is used to make the boolean clause in the enable_if dependent, otherwise it wouldn't work. However, I don't know a way to disable member variables and types using enable_if. Perhaps there is a way, I'm not aware of yet. Paul -- View this message in context: http://boost.2283326.n4.nabble.com/static-if-Is-there-interest-in-a-static-i... Sent from the Boost - Dev mailing list archive at Nabble.com.