Boost logo

Boost :

From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2007-08-25 15:27:13


On 8/25/07, Steven Watanabe <steven_at_[hidden]> wrote:
> AMDG
>
> Ion Gaztañaga <igaztanaga <at> gmail.com> writes:
>
> > -> Someone knows have to make a function static or not depending on a
> > compile-time boolean.
> >
>
> static typename boost::enable_if_c<should_be_static, result_type>::type f();
> typename boost::disable_if_c<should_be_static, result_type>::type f();
>

Does this actually work? Shouldn't enable/disable_if depend on some
template arguments of f (and f is not templated here)?

I think that, at least under gcc, this doesn't work. GCC will
complain (rightly IMHO) that 'type' is not a nested type of disable_if
*or* enable_if.

gpd

gpd


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk