overloading on keyword signature
hi, i'm following up on an earlier of my posts with a simpler example. in the example below: the overload is on argument-name and type, yet the overload is ambiguous. 1) is there a way around this? and if so, 2) is it also possible to have an overload the on argument-name only (replace string and int below by *). thanks. *.hpp namespace lib{ BOOST_PARAMETER_NAME(name) BOOST_PARAMETER_NAME(index) BOOST_PARAMETER_FUNCTION( (void), f, tag, (required (name,(std::string))) ) { std::cout << name << std::endl; } BOOST_PARAMETER_FUNCTION( (void), f, tag, (required (index,(int))) ) { std::cout << index << std::endl; } } *.cpp lib::f(lib::_name = "jill"); lib::f(lib::_index = 1); /home/er/cpp/libs/testing_names/par_fun.hpp||In function ‘typename lib::boost_param_result_27f<typename boost::parameter::aux::argument_pack<lib::boost_param_params_27f<int>, const ParameterArgumentType0, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::type>::type lib::f(const ParameterArgumentType0&, typename boost::parameter::aux::match<lib::boost_param_params_27f<int>, ParameterArgumentType0, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::type) [with ParameterArgumentType0 = boost::parameter::aux::tagged_argument<lib::tag::index, const int>]’:| /home/er/cpp/libs/testing_names/main.cpp|28|instantiated from here| /home/er/cpp/libs/testing_names/par_fun.hpp|24|error: call of overloaded ‘boost_param_implf(boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<lib::tag::index, const int>, boost::parameter::aux::empty_arg_list>)’ is ambiguous| /home/er/cpp/libs/testing_names/par_fun.hpp|16|note: candidates are: typename lib::boost_param_result_19f<Args>::type lib::boost_param_implf(const Args&) [with Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<lib::tag::index, const int>, boost::parameter::aux::empty_arg_list>]| /home/er/cpp/libs/testing_names/par_fun.hpp|24|note: typename lib::boost_param_result_27f<Args>::type lib::boost_param_implf(const Args&) [with Args = boost::parameter::aux::arg_list<const boost::parameter::aux::tagged_argument<lib::tag::index, const int>, boost::parameter::aux::empty_arg_list>]| /home/er/cpp/libs/testing_names/par_fun.hpp|24|error: return-statement with a value, in function returning 'void'| ||=== Build finished: 2 errors, 0 warnings ===|
AMDG e r wrote:
<snip>
error: call of overloaded ‘boost_param_implf(<snip>)’ is ambiguous|
This looks like a Boost.Parameter bug. Shouldn't the line number be added to the name of this function, like the others? In Christ, Steven Watanabe
on Tue Sep 16 2008, Steven Watanabe <watanabesj-AT-gmail.com> wrote:
AMDG
e r wrote:
<snip>
error: call of overloaded ‘boost_param_implf(<snip>)’ is ambiguous|
This looks like a Boost.Parameter bug. Shouldn't the line number be added to the name of this function, like the others?
Please open a ticket; a minimal example would be appreciated. Thanks, -- Dave Abrahams BoostPro Computing http://www.boostpro.com
participants (3)
-
David Abrahams
-
e r
-
Steven Watanabe