Ticket #8603: main.cpp

File main.cpp, 624 bytes (added by james.hirschorn@…, 9 years ago)

example reproducing bug

Line 
1#include <iostream>
2
3#include <boost/parameter.hpp>
4
5
6BOOST_PARAMETER_NAME(name)
7BOOST_PARAMETER_NAME(index)
8
9struct myclass_impl
10{
11 template <class ArgumentPack>
12 myclass_impl(ArgumentPack const& args)
13 {
14 std::cout << "name = " << args[_name]
15 << "; index = " << args[_index]
16 << std::endl;
17 }
18};
19
20struct myclass : myclass_impl
21{
22 BOOST_PARAMETER_CONSTRUCTOR(
23 myclass, (myclass_impl), tag
24 , (optional (name, *) (index, *)
25 )
26 ) // no semicolon
27};
28
29int main(int argc, char * argv[])
30{
31 myclass C(_name="hello", _index=0);
32}