// Copyright (C) 2011 Cromwell D. Enage // 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 #define BOOST_TEST_MAIN #include namespace your_test { namespace keyword { BOOST_PARAMETER_NAME(function) BOOST_PARAMETER_NAME(thing1) } struct foo { boost::function f; long end; template foo(ArgumentPack const& args) : f(args[keyword::_function]) , end(f(args[keyword::_thing1 | -1.0])) { } }; struct bar : foo { BOOST_PARAMETER_CONSTRUCTOR( bar, (foo), keyword::tag, (required (function, *) ) (optional (thing1, *) ) ) }; #ifndef __STATIC_FUNCTION__ long baz(double whammy) { return 0.0 < whammy ? 42 : 69; } #endif struct program { #ifdef __STATIC_FUNCTION__ static long baz(double whammy) { return 0.0 < whammy ? 42 : 69; } #endif program() { bar nun(baz, 4.0); BOOST_CHECK(nun.f == baz); BOOST_CHECK(nun.end == 42); } }; } BOOST_AUTO_TEST_CASE(ctor_macro_fun_param) { your_test::program suxors; }