/*============================================================================= Copyright (c) 2011 Michael Caisse Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #include #include #include #include #include namespace phoenix = boost::phoenix; using phoenix::arg_names::arg1; namespace test { struct foo { int x; char y; int z; }; namespace key { struct x; struct y; struct z; } } BOOST_FUSION_ADAPT_ASSOC_STRUCT( test::foo, (int, x, test::key::x) (char, y, test::key::y) (int, z, test::key::z) ) int main() { test::foo bar; bar.x = 42; bar.y = 'z'; bar.z = 8; BOOST_TEST( phoenix::at_key(arg1)(bar) == 42 ); BOOST_TEST( phoenix::at_key(arg1)(bar) == 'z' ); BOOST_TEST( phoenix::at_key(arg1)(bar) == 8 ); return boost::report_errors(); }