| 451 | |
| 452 | template <class M, class Signature> |
| 453 | void def(char const* name, Signature) |
| 454 | { |
| 455 | typedef mpl::iterator_range< |
| 456 | typename mpl::next< |
| 457 | typename mpl::begin<Signature>::type |
| 458 | >::type |
| 459 | , typename mpl::end<Signature>::type |
| 460 | > arg_types; |
| 461 | |
| 462 | typedef typename mpl::transform< |
| 463 | typename M::keywords |
| 464 | , arg_types |
| 465 | , aux::make_arg_spec<mpl::_1, mpl::_2> |
| 466 | , mpl::back_inserter<mpl::vector0<> > |
| 467 | >::type arg_specs; |
| 468 | |
| 469 | typedef typename mpl::count_if< |
| 470 | arg_specs |
| 471 | , aux::is_optional<mpl::_1> |
| 472 | >::type optional_arity; |
| 473 | |
| 474 | typedef typename mpl::front<Signature>::type result_type; |
| 475 | typedef typename mpl::shift_left<mpl::long_<1>, optional_arity>::type upper; |
| 476 | |
| 477 | aux::def_combinations( |
| 478 | aux::def_function(name) |
| 479 | , (arg_specs*)0 |
| 480 | , mpl::long_<0>() |
| 481 | , mpl::long_<upper::value>() |
| 482 | , (aux::make_invoker<M, result_type>*)0 |
| 483 | ); |
| 484 | } |
| 485 | |
| 486 | template <class M, class Class, class Signature> |
| 487 | void def(Class& cl, char const* name, Signature) |
no test coverage detected