I've already submitted a bug report, but I'm also posting it here in case
anyone has more info.
-------------
The following variation on the example from the boost::parameter tutorial,
where the required parameter is changed to optional, fails to compile.
myclass_impl is being passed an empty argument list.
#include <iostream>
#include
BOOST_PARAMETER_NAME(name)
BOOST_PARAMETER_NAME(index)
struct myclass_impl
{
template <class ArgumentPack>
myclass_impl(ArgumentPack const& args)
{
std::cout << "name = " << args[_name]
<< "; index = " << args[_index]
<< std::endl;
}
};
struct myclass : myclass_impl
{
BOOST_PARAMETER_CONSTRUCTOR(
myclass, (myclass_impl), tag
, (optional (name, *) (index, *)
)
) // no semicolon
};
int main(int argc, char * argv[])
{
myclass C(_name="hello", _index=0);
}