I had a problem getting BOOST_STATIC_ASSERT_MSG to give a meaningful error message. I welded this:
#include <boost/static_assert.hpp> namespace StaticChecks { BOOST_STATIC_ASSERT_MSG( false, "Where is my error message?" ); }
The indicated error message is not visible anywhere. Instead, I get the following:
c:\tryit> x86_64-w64-mingw32-g++ -O0 -g -m64 -Wall -IC:\boost_1_50_0 -IC:\MinGW-W64\msys\include compiletimechecks.cpp -c -o compiletimechecks.cpp.o compiletimechecks.cpp:5:5: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' compiletimechecks.cpp:5:5: error: template argument 1 is invalid compiletimechecks.cpp:5:63: error: invalid type in declaration before ';' token
I am on Windows 7 and am using GCC / C ++ 64-bit:
c:\tryit> x86_64-w64-mingw32-g++ --version x86_64-w64-mingw32-g++ (Built by MinGW-builds project) 4.7.2
I get the same error on Linux (Ubuntu 12.04 LTS 64 bit) using gcc version 4.6.3 and Boost version 1.48.
In addition, I must add that when the statement succeeds, it works as expected.
source share