Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-08 11:45:16


One thing I've noticed recently is that on many compilers, I don't get
an instantiation stack backtrace when a BOOST_STATIC_ASSERT fails,
which makes things very hard to debug. So I've taken to tricks like
this one:

    template <bool = false> struct assertion;

    template <> struct assertion<true>
    {
        typedef char type;
    };

    template <class T, class U>
    struct assert_same
        : assertion<boost::is_same<T,U>::value>
    {
    };

       ...
       typedef typename assert_same<X,Y>::type a1;

I know BOOST_STATIC_ASSERT has been finely-tuned to do what it does,
but I'd like this to be a request for even more fine tuning.

TIA,
Dave

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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