id summary reporter owner description type status milestone component version severity resolution keywords cc 7299 Spirit Karma static assert with unicode enabled on Win32 and Win64 Dave Bailey Hartmut Kaiser "The following code causes a static assert in boost/spirit/home/karma/detail/output_iterator.hpp. The problem is that buffer_sink stores charactes in a std::basic_string, but when BOOST_SPIRIT_UNICODE is defined, the output character size is 32-bit. On Windows, wchar_t is 16-bit, which will always hit the static assert. On Linux, wchar_t is 32-bit so we don't have the issue. {{{ #!cpp #ifndef BOOST_SPIRIT_UNICODE #define BOOST_SPIRIT_UNICODE #endif #include #include #include #include namespace karma = boost::spirit::karma; template struct unicode_char_ : public karma::grammar { unicode_char_() : base_type(thechar) { using karma::unicode::char_; thechar = char_; } karma::rule thechar; }; int main() { typedef std::basic_string unicode_string; typedef std::back_insert_iterator unicode_back_insert_iterator_type; unicode_string input; unicode_string output; unicode_back_insert_iterator_type insert_iter(output); unicode_char_ unichar; karma::generate(insert_iter,unichar,input); return 0; } }}}" Bugs closed To Be Determined spirit Boost 1.50.0 Problem fixed spirit karma unicode