Ticket #7299: output_iterator.hpp.patch
File output_iterator.hpp.patch, 2.1 KB (added by , 10 years ago) |
---|
-
output_iterator.hpp
21 21 #include <boost/spirit/home/karma/generator.hpp> 22 22 #include <boost/spirit/home/support/iterators/ostream_iterator.hpp> 23 23 #include <boost/spirit/home/support/unused.hpp> 24 #ifdef BOOST_SPIRIT_UNICODE 25 #include <boost/spirit/home/support/char_encoding/unicode.hpp> 26 #endif 24 27 25 28 namespace boost { namespace spirit { namespace karma { namespace detail 26 29 { … … 172 175 /////////////////////////////////////////////////////////////////////////// 173 176 class buffer_sink : boost::noncopyable 174 177 { 178 179 #ifdef BOOST_SPIRIT_UNICODE 180 typedef boost::spirit::char_encoding::unicode::char_type buffer_sink_char_type; 181 #else 182 typedef wchar_t buffer_sink_char_type; 183 #endif 184 175 185 public: 176 186 buffer_sink() 177 187 : width(0) {} … … 197 207 template <typename T> 198 208 void output(T const& value) 199 209 { 200 BOOST_STATIC_ASSERT(sizeof(T) <= sizeof( wchar_t));210 BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(buffer_sink_char_type)); 201 211 buffer.push_back(value); 202 212 } 203 213 … … 208 218 #pragma warning(push) 209 219 #pragma warning(disable: 4267) 210 220 #endif 211 typename std::basic_string< wchar_t>::const_iterator end =221 typename std::basic_string<buffer_sink_char_type>::const_iterator end = 212 222 buffer.begin() + (std::min)(buffer.size(), maxwidth); 213 223 214 224 #if defined(BOOST_MSVC) … … 224 234 #pragma warning(push) 225 235 #pragma warning(disable: 4267) 226 236 #endif 227 typename std::basic_string< wchar_t>::const_iterator begin =237 typename std::basic_string<buffer_sink_char_type>::const_iterator begin = 228 238 buffer.begin() + (std::min)(buffer.size(), start_at); 229 239 230 240 #if defined(BOOST_MSVC) … … 241 251 242 252 private: 243 253 std::size_t width; 244 std::basic_string< wchar_t> buffer;254 std::basic_string<buffer_sink_char_type> buffer; 245 255 }; 246 256 247 257 ///////////////////////////////////////////////////////////////////////////