#include BOOST_PARAMETER_NAME(name) BOOST_PARAMETER_NAME(func) BOOST_PARAMETER_NAME(docstring) BOOST_PARAMETER_NAME(keywords) BOOST_PARAMETER_NAME(policies) struct default_call_policies { }; struct no_keywords { }; struct keywords { }; #include template struct is_keyword_expression : boost::mpl::false_ { }; template <> struct is_keyword_expression : boost::mpl::true_ { }; default_call_policies some_policies; void f() { } #include #include #include #include char const*& blank_char_ptr() { static char const* larr = ""; return larr; } BOOST_PARAMETER_FUNCTION( (bool), def, tag, (required (name,(char const*)) (func,*) ) // nondeduced (deduced (optional (docstring, (char const*), blank_char_ptr()) (keywords // see 5 , *(is_keyword_expression) , no_keywords() ) (policies , *( boost::mpl::eval_if< boost::is_convertible , boost::mpl::false_ , boost::mpl::if_< // see 5 is_keyword_expression , boost::mpl::false_ , boost::mpl::true_ > > ) , default_call_policies() ) ) ) ) { return true; } #include int main() { char const* f_name = "f"; def(f_name, &f, some_policies, "Documentation for f"); def(f_name, &f, "Documentation for f", some_policies); def( f_name , &f , _policies = some_policies , "Documentation for f" ); return boost::report_errors(); }