diff --git a/include/boost/range/as_literal.hpp b/include/boost/range/as_literal.hpp index 1c16e4a..5d8c436 100644 --- a/include/boost/range/as_literal.hpp +++ b/include/boost/range/as_literal.hpp @@ -25,6 +25,11 @@ #include #include + +#if !defined(BOOST_NO_CHAR16_T) || !defined(BOOST_NO_CHAR32_T) +#include // for std::char_traits +#endif + #ifndef BOOST_NO_CWCHAR #include #endif @@ -38,6 +43,20 @@ namespace boost return strlen( s ); } +#ifndef BOOST_NO_CHAR16_T + inline std::size_t length( const char16_t* s ) + { + return std::char_traits::length( s ); + } +#endif + +#ifndef BOOST_NO_CHAR32_T + inline std::size_t length( const char32_t* s ) + { + return std::char_traits::length( s ); + } +#endif + #ifndef BOOST_NO_CWCHAR inline std::size_t length( const wchar_t* s ) { @@ -61,6 +80,30 @@ namespace boost return true; } +#ifndef BOOST_NO_CHAR16_T + inline bool is_char_ptr( char16_t* ) + { + return true; + } + + inline bool is_char_ptr( const char16_t* ) + { + return true; + } +#endif + +#ifndef BOOST_NO_CHAR32_T + inline bool is_char_ptr( char32_t* ) + { + return true; + } + + inline bool is_char_ptr( const char32_t* ) + { + return true; + } +#endif + #ifndef BOOST_NO_CWCHAR inline bool is_char_ptr( wchar_t* ) {