regression_real_0.cpp 756 B

123456789101112131415161718192021222324
  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. #include <boost/config/warning_disable.hpp>
  7. #include <boost/spirit/include/karma.hpp>
  8. #include <boost/detail/lightweight_test.hpp>
  9. #include <iterator>
  10. #include <sstream>
  11. #include <string>
  12. int main()
  13. {
  14. namespace karma = boost::spirit::karma;
  15. std::string output;
  16. std::back_insert_iterator< std::string > sink = std::back_inserter( output );
  17. karma::generate( sink, karma::double_, 0 ); // prints ¨inf¨ instead of ¨0.0¨
  18. BOOST_TEST((output == "0.0"));
  19. return boost::report_errors();
  20. }