Last change
on this file since 29 was
29,
checked in by landauf, 16 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
826 bytes
|
Line | |
---|
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/keyword.hpp> |
---|
6 | #include <boost/parameter/aux_/maybe.hpp> |
---|
7 | #include <cassert> |
---|
8 | |
---|
9 | namespace test { |
---|
10 | |
---|
11 | BOOST_PARAMETER_KEYWORD(tag, kw) |
---|
12 | BOOST_PARAMETER_KEYWORD(tag, unused) |
---|
13 | |
---|
14 | template <class Args> |
---|
15 | int f(Args const& args) |
---|
16 | { |
---|
17 | return args[kw | 1.f]; |
---|
18 | } |
---|
19 | |
---|
20 | } // namespace test |
---|
21 | |
---|
22 | int main() |
---|
23 | { |
---|
24 | using test::kw; |
---|
25 | using test::unused; |
---|
26 | using test::f; |
---|
27 | using boost::parameter::aux::maybe; |
---|
28 | |
---|
29 | assert(f((kw = 0, unused = 0)) == 0); |
---|
30 | assert(f(unused = 0) == 1); |
---|
31 | assert(f((kw = maybe<int>(), unused = 0)) == 1); |
---|
32 | assert(f((kw = maybe<int>(2), unused = 0)) == 2); |
---|
33 | return 0; |
---|
34 | } |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.