Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-06-24 09:34:14


AMDG

Andrey Semashev wrote:
> This is a sample error report from BOOST_STATIC_ASSERT:
>
> ./assert1.cpp: In instantiation of ‘A<-0x00000000000000005>’:
> ./assert1.cpp:12: instantiated from here
> ./assert1.cpp:6: error: invalid application of ‘sizeof’ to incomplete
> type ‘boost::STATIC_ASSERTION_FAILURE<false>’
>
> And this is what BOOST_MPL_ASSERT_RELATION produces:
>
> ./assert2.cpp: In instantiation of ‘A<-0x00000000000000005>’:
> ./assert2.cpp:12: instantiated from here
> ./assert2.cpp:6: error: no matching function for call to
> ‘assertion_failed(mpl_::failed************
> mpl_::assert_relation<greater, -0x00000000000000005l, 0l>::************)’
>
> Honestly, I don't see much difference except that, as it was noted,
> there are hints to the problem source in the latter output. Upper-case
> STATIC_ASSERTION_FAILURE do highlight error just as well as those
> asterixes.

If -0x00000000000000005l and 0l are the result of template
metaprogramming rather than hard coded,
the BOOST_STATIC_ASSERT message is /much/ less helpful, IMO.

In Christ,
Steven Watanabe


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