
On 2006-10-18, John Maddock <john@johnmaddock.co.uk> wrote:
John Maddock wrote: Hmm, I think this is completely beyond me. I can't even find where that cast to int comes from. Here is the preprocessed source code for reference: Hmm, I managed to find a copy of gcc-4.1 to test with, and this completely
Markus Schöpflin wrote: perplexes me too. In fact I can't find *anything* in the mpl sources or tests that look like the code in the error message!
I'm pretty sure it's a compiler bug. The code in question is below (with my little bit added): template< typename T > void count_test() { #if DEFINE_THIS_TO_MAKE_THE_TEST_COMPILE enum { v1 = count<typename T::s0,int>::value }; enum { v2 = count<typename T::s1,int>::value }; enum { v3 = count<typename T::s2,int>::value }; enum { v4 = count<typename T::s2,char&>::value }; enum { v5 = count<typename T::s3,int>::value }; enum { v6 = count<typename T::s3,char&>::value }; enum { v7 = count<typename T::s4,abstract>::value }; #endif MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s0,int>::value ), ==, 0 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s1,int>::value ), ==, 1 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s2,int>::value ), ==, 1 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s2,char&>::value ), ==, 1 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s3,int>::value ), ==, 2 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s3,char&>::value ), ==, 1 ); MPL_ASSERT_RELATION( ( count<BOOST_DEDUCED_TYPENAME T::s4,abstract>::value ), ==, 1 ); } If you enable the #if'd code, then the test compiles fine; if you don't then you get that strange error. It shouldn't, of course, make any difference... phil -- change name before "@" to "phil" for email