diff -urb -x .svn trunk/boost/mpl/string.hpp trunk_patched/boost/mpl/string.hpp --- trunk/boost/mpl/string.hpp 2009-04-18 17:43:51.000000000 +0400 +++ trunk_patched/boost/mpl/string.hpp 2009-04-18 17:41:21.000000000 +0400 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -243,12 +244,6 @@ type; }; - template - struct apply, Value, false> - { - typedef mpl::string<(char)Value::value> type; - }; - #define M0(z,n,data) \ template \ struct apply, Value, true> \ @@ -268,10 +263,14 @@ struct apply, Value, false> { typedef - mpl::string< + typename mpl::if_< + mpl::empty > + , mpl::string<(char)Value::value> + , mpl::string< ((((unsigned char)Value::value)<<(BOOST_MPL_MULTICHAR_LENGTH(C0)*8))|C0) , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C) > + >::type type; }; }; diff -urb -x .svn trunk/libs/mpl/test/string.cpp trunk_patched/libs/mpl/test/string.cpp --- trunk/libs/mpl/test/string.cpp 2009-04-18 17:43:51.000000000 +0400 +++ trunk_patched/libs/mpl/test/string.cpp 2009-04-18 17:39:47.000000000 +0400 @@ -293,6 +293,9 @@ BOOST_MPL_ASSERT((boost::is_same >)); } + BOOST_MPL_ASSERT((mpl::empty >)); + BOOST_MPL_ASSERT_NOT((mpl::empty >)); + // testing push_front { typedef mpl::push_front, mpl::char_<'a'> >::type t1; @@ -343,9 +346,6 @@ mpl::for_each >(push_char(result)); BOOST_TEST("Hello world!" == result); - BOOST_MPL_ASSERT((mpl::empty >)); - BOOST_MPL_ASSERT_NOT((mpl::empty >)); - BOOST_TEST(('h' == mpl::front >::type())); BOOST_TEST(('!' == mpl::back >::type()));