From bf259091505bc639b879c8c80a2204464b060eb8 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Tue, 7 Apr 2009 19:53:53 +0000 Subject: [PATCH] msvc-7.1 portability fix, signed/unsigned warning fix [SVN r52241] --- include/boost/mpl/string.hpp | 37 +++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/include/boost/mpl/string.hpp b/include/boost/mpl/string.hpp index 72f7aeb..09e50ee 100644 --- a/include/boost/mpl/string.hpp +++ b/include/boost/mpl/string.hpp @@ -14,6 +14,8 @@ // $Date: 2009-04-01 02:10:26 -0700 (Wed, 1 Apr 2009) $ // $Revision: 49239 $ +#include +#include #include #include #include @@ -52,7 +54,7 @@ namespace boost { namespace mpl template struct string; - template + template struct string_iterator; template @@ -299,18 +301,18 @@ namespace boost { namespace mpl template struct apply { - typedef mpl::long_ type; + typedef mpl::long_<(long)Last::index - (long)First::index> type; }; }; - template + template struct string_iterator : Sequence::template at { typedef string_iterator_tag tag; typedef std::random_access_iterator_tag category; typedef Sequence string_type; - static long const index = N; + static unsigned long const index = N; typedef string_iterator next; typedef string_iterator prior; }; @@ -331,15 +333,36 @@ namespace boost { namespace mpl static std::size_t const size = BOOST_MPL_MULTICHAR_LENGTH(C0) + rest_::size; - template + #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + private: + /// INTERNAL ONLY + template + struct at_impl + : boost::mpl::char_ + {}; + + /// INTERNAL ONLY + template + struct at_impl + : rest_::template at + {}; + + public: + template + struct at + : at_impl + {}; + #else + template struct at : boost::mpl::char_ {}; - template + template struct at : rest_::template at {}; + #endif static char const c_str[]; }; @@ -378,7 +401,7 @@ namespace boost { namespace mpl static std::size_t const size = 0; - template + template struct at : boost::mpl::char_<'\0'> {};