forked from boostorg/utility
Cleanups and clarification
[SVN r2555]
This commit is contained in:
1 parent
c5826cb47b
commit
2c3c79aec5
2 files changed
+20
-17
No files matched your search
@@ -16,8 +16,8 @@ namespace test
|
||||
keyword<struct name_> name;
|
||||
keyword<struct value_> value;
|
||||
|
||||
struct f_keywords
|
||||
: keywords<
|
||||
struct f_parameters
|
||||
: parameters<
|
||||
optional<
|
||||
name_
|
||||
, boost::is_convertible<boost::mpl::_, std::string>
|
||||
@@ -29,33 +29,36 @@ namespace test
|
||||
>
|
||||
{};
|
||||
|
||||
template <class T> struct not_implemented;
|
||||
|
||||
template<class P>
|
||||
void f_impl(P const& p)
|
||||
{
|
||||
std::string s = p[name | "bar"];
|
||||
float v = p[value | 3.f];
|
||||
|
||||
std::cout << "s is " << s << std::endl;
|
||||
assert(s == "foo");
|
||||
assert(v == 3.f);
|
||||
}
|
||||
|
||||
void f()
|
||||
|
||||
void f(...)
|
||||
{
|
||||
f_impl(f_keywords()());
|
||||
f_impl(f_parameters()());
|
||||
}
|
||||
|
||||
template<class A0>
|
||||
void f(A0 const& a0
|
||||
, typename f_keywords::restrict<A0>::type = f_keywords())
|
||||
, typename f_parameters::restrict<A0>::type = f_parameters())
|
||||
{
|
||||
f_impl(f_keywords()(a0));
|
||||
f_impl(f_parameters()(a0));
|
||||
}
|
||||
|
||||
template<class A0, class A1>
|
||||
void f(A0 const& a0, A1 const& a1
|
||||
, typename f_keywords::restrict<A0, A1>::type = f_keywords())
|
||||
, typename f_parameters::restrict<A0, A1>::type = f_parameters())
|
||||
{
|
||||
f_impl(f_keywords()(a0, a1));
|
||||
f_impl(f_parameters()(a0, a1));
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
|
||||
Reference in new issue
Block a user