1 | #include <boost/parameter/name.hpp>
|
---|
2 | #include <boost/parameter/binding.hpp>
|
---|
3 |
|
---|
4 | BOOST_PARAMETER_NAME(my_param)
|
---|
5 |
|
---|
6 | template <typename T> struct s {};
|
---|
7 |
|
---|
8 | struct bogus {
|
---|
9 | typedef void boost_parameter_use_template_call;
|
---|
10 | template <typename U> struct result: public s<U> {};
|
---|
11 | template <typename Arg>
|
---|
12 | typename result<bogus(Arg)>::type
|
---|
13 | operator()(Arg) const {return 0;}
|
---|
14 | };
|
---|
15 |
|
---|
16 | template <typename ArgPack>
|
---|
17 | void f(const ArgPack& ap) {
|
---|
18 | const char* cs = ap[_my_param || bogus()];
|
---|
19 | }
|
---|
20 |
|
---|
21 | int main(int, char**) {
|
---|
22 | f(_my_param = "param");
|
---|
23 | return 0;
|
---|
24 | }
|
---|