diff --git a/test/named_params_sfinae.cpp b/test/named_params_sfinae.cpp index 86bc143..8725417 100755 --- a/test/named_params_sfinae.cpp +++ b/test/named_params_sfinae.cpp @@ -11,25 +11,21 @@ namespace test { - using boost::keyword; - using boost::keywords; - using boost::named_param; + using namespace boost::named_params; - struct name_t; keyword name; - struct value_t; keyword value; + keyword name; + keyword value; struct f_keywords - : keywords< - named_param< - name_t - , boost::mpl::true_ - , boost::is_convertible - > - , named_param< - value_t - , boost::mpl::true_ - , boost::is_convertible - > + : keywords< + optional< + name_ + , boost::is_convertible + > + , optional< + value_ + , boost::is_convertible + > > {}; diff --git a/test/named_params_test.cpp b/test/named_params_test.cpp index d9947e5..352a0e5 100755 --- a/test/named_params_test.cpp +++ b/test/named_params_test.cpp @@ -12,29 +12,19 @@ namespace test { - - using boost::keyword; - using boost::keywords; - using boost::named_param; - - struct name_t; - keyword name; - - struct value_t; - keyword value; - - struct index_t; - keyword index; - - struct tester_t; - keyword tester; + using namespace boost::named_params; + + keyword name; + keyword value; + keyword index; + keyword tester; struct f_keywords // vc6 is happier with inheritance than with a typedef : keywords< - tester_t - , name_t - , value_t - , index_t + tester_ + , name_ + , value_ + , index_ > {}; @@ -49,7 +39,8 @@ namespace test p[tester]( p[name] , p[value || boost::bind(&value_default) ] - , p[index | 999] +// , p[value | 666.222 ] + , p[index | 999 ] ); return 1; } @@ -128,6 +119,26 @@ namespace test { return values_t(n,v,i); } + + typedef f_keywords g_keywords; + + template + int g_impl(Args const& args) + { + return f(args); + } + + template + int g(A0 const& a0) + { + return g_impl(g_keywords(a0)); + } + + template + int g(A0 const& a0, A1 const& a1) + { + return g_impl(g_keywords(a0, a1)); + } } // GCC2 has a problem with char (&)[] deduction, so we'll cast string