Last change
on this file since 29 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
927 bytes
|
Line | |
---|
1 | //~ Copyright Rene Rivera 2006. |
---|
2 | //~ Use, modification and distribution is subject to the Boost Software License, |
---|
3 | //~ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
4 | //~ http://www.boost.org/LICENSE_1_0.txt) |
---|
5 | |
---|
6 | #include <boost/parameter.hpp> |
---|
7 | |
---|
8 | namespace param |
---|
9 | { |
---|
10 | BOOST_PARAMETER_KEYWORD(Tag,a0) |
---|
11 | BOOST_PARAMETER_KEYWORD(Tag,a1) |
---|
12 | BOOST_PARAMETER_KEYWORD(Tag,a2) |
---|
13 | } |
---|
14 | |
---|
15 | namespace test |
---|
16 | { |
---|
17 | struct A |
---|
18 | { |
---|
19 | int i; |
---|
20 | int j; |
---|
21 | |
---|
22 | template <typename ArgPack> A(ArgPack const & args) |
---|
23 | { |
---|
24 | i = args[param::a0]; |
---|
25 | j = args[param::a1]; |
---|
26 | } |
---|
27 | }; |
---|
28 | |
---|
29 | struct B : A |
---|
30 | { |
---|
31 | template <typename ArgPack> B(ArgPack const & args) |
---|
32 | : A((args, param::a0 = 1)) |
---|
33 | { |
---|
34 | } |
---|
35 | }; |
---|
36 | } |
---|
37 | |
---|
38 | int main() |
---|
39 | { |
---|
40 | test::A a((param::a0 = 1, param::a1 = 13, param::a2 = 6)); |
---|
41 | test::B b0((param::a1 = 13)); |
---|
42 | test::B b1((param::a1 = 13, param::a2 = 6)); |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.