1 // Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
2 // distribution is subject to the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef TAGGED_ARGUMENT_050328_HPP
7 #define TAGGED_ARGUMENT_050328_HPP
9 #include <boost/parameter/aux_/void.hpp>
10 #include <boost/parameter/aux_/arg_list.hpp>
11 #include <boost/detail/is_xxx.hpp>
13 namespace boost { namespace parameter { namespace aux {
15 // Holds a reference to an argument of type Arg associated with
18 template <class Keyword, class Arg>
19 struct tagged_argument
21 typedef Keyword key_type;
22 typedef Arg value_type;
23 typedef Arg& reference;
25 tagged_argument(reference x) : value(x) {}
27 // Comma operator to compose argument list without using parameters<>.
28 // Useful for argument lists with undetermined length.
29 template <class Keyword2, class Arg2>
31 tagged_argument<Keyword, Arg>
32 , arg_list<tagged_argument<Keyword2, Arg2> >
34 operator,(tagged_argument<Keyword2, Arg2> x) const
37 tagged_argument<Keyword, Arg>
38 , arg_list<tagged_argument<Keyword2, Arg2> >
41 , arg_list<tagged_argument<Keyword2, Arg2> >(x, empty_arg_list())
48 // Defines a metafunction, is_tagged_argument, that identifies
49 // tagged_argument specializations.
50 BOOST_DETAIL_IS_XXX_DEF(tagged_argument,tagged_argument,2)
52 }}} // namespace boost::parameter::aux
54 #endif // TAGGED_ARGUMENT_050328_HPP