1 | // Copyright Daniel Wallin 2006. |
2 | // Distributed under the Boost Software License, Version 1.0. |
3 | // (See accompanying file LICENSE_1_0.txt or copy at |
4 | // http://www.boost.org/LICENSE_1_0.txt) |
5 | |
6 | #ifndef BOOST_PARAMETER_AUX_NAME_HPP |
7 | #define BOOST_PARAMETER_AUX_NAME_HPP |
8 | |
9 | namespace boost { namespace parameter { namespace aux { |
10 | |
11 | struct name_tag_base |
12 | { |
13 | }; |
14 | |
15 | template <typename Tag> |
16 | struct name_tag |
17 | { |
18 | }; |
19 | }}} // namespace boost::parameter::aux |
20 | |
21 | #include <boost/mpl/bool.hpp> |
22 | |
23 | namespace boost { namespace parameter { namespace aux { |
24 | |
25 | template <typename T> |
26 | struct is_name_tag : ::boost::mpl::false_ |
27 | { |
28 | }; |
29 | }}} // namespace boost::parameter::aux |
30 | |
31 | #include <boost/parameter/value_type.hpp> |
32 | #include <boost/mpl/placeholders.hpp> |
33 | #include <boost/config.hpp> |
34 | #include <boost/config/workaround.hpp> |
35 | |
36 | #if !defined(BOOST_NO_SFINAE) && \ |
37 | !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592)) |
38 | #include <boost/parameter/aux_/lambda_tag.hpp> |
39 | #include <boost/mpl/lambda.hpp> |
40 | #include <boost/mpl/bind.hpp> |
41 | #include <boost/mpl/quote.hpp> |
42 | #include <boost/core/enable_if.hpp> |
43 | |
44 | namespace boost { namespace mpl { |
45 | |
46 | template <typename T> |
47 | struct lambda< |
48 | T |
49 | , typename ::boost::enable_if< |
50 | ::boost::parameter::aux::is_name_tag<T> |
51 | , ::boost::parameter::aux::lambda_tag |
52 | >::type |
53 | > |
54 | { |
55 | typedef ::boost::mpl::true_ is_le; |
56 | typedef ::boost::mpl::bind3< |
57 | ::boost::mpl::quote3< ::boost::parameter::value_type> |
58 | , ::boost::mpl::arg<2> |
59 | , T |
60 | , void |
61 | > result_; |
62 | typedef result_ type; |
63 | }; |
64 | }} // namespace boost::mpl |
65 | |
66 | #endif // SFINAE enabled, not Borland. |
67 | |
68 | #include <boost/parameter/aux_/void.hpp> |
69 | |
70 | #define BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) \ |
71 | ::boost::parameter::value_type< \ |
72 | ::boost::mpl::_2,tag,::boost::parameter::void_ \ |
73 | > |
74 | /**/ |
75 | |
76 | #if defined(BOOST_PARAMETER_CAN_USE_MP11) |
77 | #define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(name, tag) \ |
78 | template <typename ArgumentPack> \ |
79 | using name = typename ::boost::parameter \ |
80 | ::value_type<ArgumentPack,tag,::boost::parameter::void_>::type |
81 | /**/ |
82 | |
83 | #include <boost/parameter/binding.hpp> |
84 | |
85 | #define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(name, tag) \ |
86 | template <typename ArgumentPack> \ |
87 | using name = typename ::boost::parameter \ |
88 | ::binding<ArgumentPack,tag,::boost::parameter::void_>::type |
89 | /**/ |
90 | |
91 | #endif // BOOST_PARAMETER_CAN_USE_MP11 |
92 | #endif // include guard |
93 | |
94 | |