From 6d2663266b60f035f0f3dcd45a5a466c425197ad Mon Sep 17 00:00:00 2001 From: Daniel Wallin Date: Sat, 17 Jan 2004 15:53:40 +0000 Subject: [PATCH] bug fixes [SVN r1894] --- test/named_params_sfinae.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/test/named_params_sfinae.cpp b/test/named_params_sfinae.cpp index 124c423..ed9c66a 100755 --- a/test/named_params_sfinae.cpp +++ b/test/named_params_sfinae.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace test { @@ -29,17 +30,35 @@ namespace test , boost::mpl::true_ , boost::is_convertible > - > + > {}; - BOOST_NAMED_PARAMS_FUN(void, f, 0, 2, f_keywords) + template + void f_impl(P const& p) { std::string s = p[name | "bar"]; float v = p[value | 3.f]; - + assert(s == "foo"); assert(v == 3.f); } + + void f() + { + f_impl(f_keywords()()); + } + + template + void f(A0 const& a0, typename f_keywords::restrict::type = f_keywords()) + { + f_impl(f_keywords()(a0)); + } + + template + void f(A0 const& a0, A1 const& a1) + { + f_impl(f_keywords()(a0, a1)); + } } // namespace test @@ -52,5 +71,7 @@ int main() f("foo"); f("foo", 3.f); f(value = 3.f, name = "foo"); + + return 0; }