Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-03-17 13:25:05


"Ian McCulloch" <ianmcc_at_[hidden]> wrote

> lack of SFINAE is a real showstopper for me. I want to write functions
> like
>
> template <typename T>
> typename result_of<negate(T)>::type
> operator-(T const& x)
> {
> return negate()(x);
> }
>
> but the lack of SFINAE here makes boost::result_of essentially useless for
> this. But I imagine it won't be difficult to make a new version based on
> boost that would work.

FWIW:

template<class T>
T make();

template <class T>
BOOST_TYPEOF_TPL(make<std::negate<T> >()(T()))
operator-(T const& x)
{
    return std::negate<T>()(x);
}

Regards,
Arkadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net