2 回答
You need to compile boost with BOOST_LOCALE_ENABLE_CHAR32_T
to include the boundary_indexing<char32_t>
but ...
Status of C++11 char16_t/char32_t support
The support of C++11
char16_t
andchar32_t
is experimental, mostly does not work and not intended to be used in production with current latest compilers: GCC-4.5, MSVC10 till major compiler's flaws would be fixed.[....]
If you want to build or test Boost.Locale with C++11 char16_t and char32_t support you should pass
cxxflags="-DBOOST_LOCALE_ENABLE_CHAR32_T -DBOOST_LOCALE_ENABLE_CHAR16_T"
to b2 during build and defineBOOST_LOCALE_ENABLE_CHAR32_T
andBOOST_LOCALE_ENABLE_CHAR32_T
when using Boost.Locale
[emphasis mine]
http://www.boost.org/doc/libs/1_66_0/libs/locale/doc/html/facets_8hpp_source.html
#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
template<>
class BOOST_LOCALE_DECL boundary_indexing<char32_t> : public std::locale::facet {
It complains invalid use of incomplete type ‘const class boost::locale::boundary::boundary_indexing’ What's wrong?
char32_t
is not supported. Use
#define BOOST_LOCALE_ENABLE_CHAR32_T
But you need to enable it during building the library, as well:
Experimental support for C++0x char16_t and char32_t strings and streams.
Further looking: http://www.boost.org/doc/libs/1_64_0/libs/locale/doc/html/status_of_cpp0x_characters_support.html
If you want to build or test Boost.Locale with C++11 char16_t and char32_t support you should pass cxxflags="-DBOOST_LOCALE_ENABLE_CHAR32_T -DBOOST_LOCALE_ENABLE_CHAR16_T" to b2 during build and define BOOST_LOCALE_ENABLE_CHAR32_T and BOOST_LOCALE_ENABLE_CHAR32_T when using Boost.Locale