Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-28 11:02:49


Daniel Wallin <dalwan01_at_[hidden]> writes:

>> Personally, I like Joel de Guzman's version, but I also like using
>> boost
>> operators, so for me a mix of the two would be good:
>> [snip]
>
> Here's another one:
>
> template <class T>
> struct bool_testable
> {
> protected:
> bool_testable()
> {
> BOOST_STATIC_ASSERT(!(
> boost::is_convertible<T, int>::value)
> );
> }

Anything based on this technique will unfortunately fail when T has a
private conversion to int.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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