Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-09-05 06:55:38


David Abrahams writes:
> "Jonathan Turkanis" <technews_at_[hidden]> writes:
>
> > I liked BOOST_MPL_ASSERT_IS_SAME because I didn't have to use double
> > parantheses.
>
> But you were out of luck if one of the types contained commas.
>
> BOOST_MPL_ASSERT_IS_SAME(T, pair<int, long>) // error!
>
> and no amount of parenthesization could fix it.

Not to mention that when the assertion actually failed, you couldn't
see what *is* the T. Now you get a beautiful error along these lines:

C:\home\depot\stuff\asserts.cpp(8) : error C2664: 'boost::mpl::assertion_failed' :
cannot convert parameter 1 from
'boost::mpl::failed ************boost::is_same<T,U>::* *********** '
to 'boost::mpl::assert<false>::type'
        with
        [
            T=std::pair<int,char>,
            U=std::pair<int,long>
        ]
        A reference that is not to 'const' cannot be bound to a non-lvalue

--
Aleksey Gurtovoy
MetaCommunications Engineering

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