Boost logo

Boost :

Subject: Re: [boost] New, powerful way to use enable_if in C++0x
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2011-04-11 17:28:54

On Mon, Apr 11, 2011 at 5:07 PM, Krzysztof Czainski <1czajnik_at_[hidden]>wrote:

> I love this! ;-)
> Another drawback is the necesicy to use the typename keyword, which
> suggests
> at first glance, that this is a type template parameter, while it actually
> is a constant template parameter. The fact, that boost::enabler is hidden
> from user view, so the user can't see it isn't a type, doesn't help.
> For an alternative without boost::enabler, how about:
> typename boost::enable_if< boost::is_arithmetic<T>, int >::type = 0
> Regards
> Kris

That's good too. I guess whoever maintains boost.Enable_If could make the
call as to what to suggest. The only thing I kind of like about the
boost::enabler version is that it's extremely unlikely that it would
conflict with another template declaration as pretty much no one ever uses
void*& template parameter types in practice. It is rather odd to see though.

-Matt Calabrese

Boost list run by bdawes at, gregod at, cpdaniel at, john at