Boost logo

Boost :

Subject: Re: [boost] [concept] EqualityComparable metafunction
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-09-05 20:32:59

on Mon Sep 05 2011, Lorenzo Caminiti <> 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

No, that won't get you what you want: concepts eagerly generate hard
errors when not satisfied. I think we've had at least one proposal of a
library to support this, but if no off-the-shelf solution presents
itself, you could copy the pattern given by

Dave Abrahams
BoostPro Computing

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