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::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