| 1 | // Copyright (c) 2012 Agustin K-ballo Berge |
|---|---|
| 2 | // Copyright (c) 2001-2012 Hartmut Kaiser |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | |
| 7 | #include <boost/spirit/include/karma.hpp> |
| 8 | |
| 9 | #include <boost/core/lightweight_test.hpp> |
| 10 | |
| 11 | #include <iterator> |
| 12 | #include <sstream> |
| 13 | #include <string> |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | namespace karma = boost::spirit::karma; |
| 18 | std::string output; |
| 19 | std::back_insert_iterator< std::string > sink = std::back_inserter( x&: output ); |
| 20 | karma::generate( sink_&: sink, expr: karma::double_, attr: 0 ); // prints ¨inf¨ instead of ¨0.0¨ |
| 21 | BOOST_TEST((output == "0.0")); |
| 22 | return boost::report_errors(); |
| 23 | } |
| 24 | |
| 25 |
