]>
Commit | Line | Data |
---|---|---|
1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is | |
2 | // subject to the Boost Software License, Version 1.0. (See accompanying | |
3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
4 | ||
5 | #include <boost/parameter/parameters.hpp> | |
6 | #include <boost/parameter/name.hpp> | |
7 | #include <boost/parameter/binding.hpp> | |
8 | #include <boost/type_traits.hpp> | |
9 | #include "deduced.hpp" | |
10 | ||
11 | namespace parameter = boost::parameter; | |
12 | namespace mpl = boost::mpl; | |
13 | ||
14 | BOOST_PARAMETER_NAME(x) | |
15 | BOOST_PARAMETER_NAME(y) | |
16 | BOOST_PARAMETER_NAME(z) | |
17 | ||
18 | int main() | |
19 | { | |
20 | using namespace parameter; | |
21 | using boost::is_same; | |
22 | using boost::remove_reference; | |
23 | using boost::add_reference; | |
24 | ||
25 | check< | |
26 | parameters< | |
27 | tag::x | |
28 | , optional< | |
29 | deduced<tag::y> | |
30 | #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) | |
31 | , is_same< | |
32 | mpl::_1 | |
33 | , remove_reference<binding<mpl::_2,tag::x> > | |
34 | > | |
35 | #else | |
36 | , is_same< | |
37 | add_reference<mpl::_1> | |
38 | , binding<mpl::_2,tag::x> | |
39 | > | |
40 | #endif | |
41 | > | |
42 | > | |
43 | >( | |
44 | (_x = 0, _y = 1) | |
45 | , 0 | |
46 | , 1 | |
47 | ); | |
48 | ||
49 | check< | |
50 | parameters< | |
51 | tag::x | |
52 | , optional< | |
53 | deduced<tag::y> | |
54 | #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) | |
55 | , is_same< | |
56 | mpl::_1 | |
57 | , remove_reference<binding<mpl::_2,tag::x> > | |
58 | > | |
59 | #else | |
60 | , is_same< | |
61 | add_reference<mpl::_1> | |
62 | , binding<mpl::_2,tag::x> | |
63 | > | |
64 | #endif | |
65 | > | |
66 | > | |
67 | >( | |
68 | (_x = 0U, _y = 1U) | |
69 | , 0U | |
70 | , 1U | |
71 | ); | |
72 | ||
73 | check< | |
74 | parameters< | |
75 | tag::x | |
76 | , optional< | |
77 | deduced<tag::y> | |
78 | , is_same< | |
79 | mpl::_1 | |
80 | , tag::x::_ | |
81 | > | |
82 | > | |
83 | > | |
84 | >( | |
85 | (_x = 0U, _y = 1U) | |
86 | , 0U | |
87 | , 1U | |
88 | ); | |
89 | ||
90 | check< | |
91 | parameters< | |
92 | tag::x | |
93 | , optional< | |
94 | deduced<tag::y> | |
95 | , is_same< | |
96 | mpl::_1 | |
97 | , tag::x::_1 | |
98 | > | |
99 | > | |
100 | > | |
101 | >( | |
102 | (_x = 0U, _y = 1U) | |
103 | , 0U | |
104 | , 1U | |
105 | ); | |
106 | ||
107 | return 0; | |
108 | } | |
109 |