Ticket #7635: karma_real_0.cpp
File karma_real_0.cpp, 477 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | |
2 | #include <boost/assert.hpp> |
3 | |
4 | #include <boost/spirit/include/karma.hpp> |
5 | |
6 | #include <iterator> |
7 | #include <sstream> |
8 | #include <string> |
9 | |
10 | int main( int argc, char** argv ) |
11 | { |
12 | namespace karma = boost::spirit::karma; |
13 | |
14 | std::string output; |
15 | std::back_insert_iterator< std::string > sink = std::back_inserter( output ); |
16 | karma::generate( sink, karma::double_, 0 ); // prints ¨inf¨ instead of ¨0.0¨ |
17 | |
18 | BOOST_ASSERT(( output == "0.0" )); |
19 | |
20 | return 0; |
21 | } |