|
Boost : |
Subject: Re: [boost] [concept] EqualityComparable metafunction
From: Allan Johns (allan.johns_at_[hidden])
Date: 2011-09-05 20:29:46
boost aside, this article is a great working example of a hand-rolled SFINAE
approach
http://www.martinecker.com/wiki/index.php?title=Detecting_the_Existence_of_Operators_at_Compile-Time
On Tue, Sep 6, 2011 at 10:00 AM, Jeffrey Lee Hellrung, Jr. <
jeffrey.hellrung_at_[hidden]> wrote:
> On Mon, Sep 5, 2011 at 3:30 PM, Lorenzo Caminiti <lorcaminiti_at_[hidden]
> >wrote:
>
> > Hello all,
> >
> > What is the best way to check if a type T is EqualityComparable?
> >
> > Essentially, I would need a is_equality_comparable<> metafunction:
> >
> > struct mytype {};
> >
> > is_equality_comparable<int>::value // true
> > is_equality_comparable<mytype>::value // false
> >
> > Can I re-use the boost::EqualityComparable concept to implement
> > is_equality_comparable<>? Or, shall I just try to use
> > introspection-SFINAE techniques?
> >
> > Thanks in advance.
> > --Lorenzo
> >
>
> I think the (relatively) recently-reviewed TypeTraits Extension by Frederic
> Bron has what you're looking for, although I have no idea what the name of
> the particular metafunction is at the moment :) has_operator_equals?
>
> - Jeff
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk