1
4

2 回答 2

1

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 and char32_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 define BOOST_LOCALE_ENABLE_CHAR32_T and BOOST_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 {
于 2018-02-14T15:34:12.153 回答
1

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

于 2018-02-14T15:34:19.187 回答