1 // Copyright (c) 2010 Michael Caisse 2 // Copyright (c) 2001-2010 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/config/warning_disable.hpp> 8 #include <boost/detail/lightweight_test.hpp> 9 10 #include <string> 11 #include <vector> 12 #include <boost/spirit/include/karma.hpp> 13 #include <boost/spirit/include/phoenix.hpp> 14 15 #include "test.hpp" 16 17 using namespace spirit_test; 18 19 namespace karma = boost::spirit::karma; 20 namespace phx = boost::phoenix; 21 main()22int main() 23 { 24 using karma::int_; 25 using karma::_1; 26 27 BOOST_TEST(test("16909060", int_[ _1 = phx::val(0x01020304) ])); 28 29 // make sure the passed attribute type does not enforce the attribute type 30 // for the semantic action 31 unsigned char char_value = 8; 32 BOOST_TEST(test("16909060", int_[ _1 = phx::val(0x01020304) ], char_value)); 33 34 return boost::report_errors(); 35 } 36