The following variation does not seem to work according to the documentation.
Can someone explain this?
--------------------
#include <iostream>
#include
BOOST_PARAMETER_NAME(name)
BOOST_PARAMETER_NAME(index)
BOOST_PARAMETER_NAME(ratio)
struct myclass_impl
{
template <class ArgumentPack>
myclass_impl(ArgumentPack const& args)
{
std::cout << "name = " << args[_name | ""]
<< "; index = " << args[_index | 0]
<< "; ratio = " << args[_ratio | 1.0]
<< std::endl;
}
};
struct myclass : myclass_impl
{
BOOST_PARAMETER_CONSTRUCTOR(
myclass, (myclass_impl), tag
, (optional (name, (char const*)) (index, (int))
)
(deduced
(optional (ratio, *))
)
)
};
int main(int argc, char * argv[])
{
myclass C(_name="hello", _index=1);
myclass D(4.6);
}
----------------
In the construction of D, 4.6 is not deduced as having the keyword ratio,
and the program fails to compile. The deduced clause seems to be ignored.
Is this not a bug?
--
View this message in context: http://boost.2283326.n4.nabble.com/parameter-BOOST-PARAMETER-CONSTRUCTOR-bug...
Sent from the Boost - Dev mailing list archive at Nabble.com.