$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Daniel Wallin (daniel_at_[hidden])
Date: 2007-10-04 03:47:40
François Duranleau wrote:
> Great! And now, is there a simpler way to do the same thing for other 
> parameters other than doing this:
> 
> BOOST_PARAMETER_FUNCTION(
>      (some_return_type)
>      the_function ,
>      kw ,
>      (required
>       (arg1 , *)
>       (arg2 , *(boost::is_same< boost::mpl::_ , kw::arg1::_ >))
>      )      //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> )
> 
> ?
No, not in general. If you are repeating something like that, you could
factor it out to a metafunction class:
  template <class Tag>
  struct same_as
  {
      template <class T, class Args>
      struct apply
        : boost::is_same<
              T
            , typename boost::parameter::value_type<
                  Args, Tag, void
              >::type
          >
      {};
  };
  BOOST_PARAMETER_FUNCTION(
       (some_return_type)
       the_function ,
       kw ,
       (required
        (arg1 , *)
        (arg2 , *(same_as<kw::arg1>))
       )
  )
HTH,
-- Daniel Wallin Boost Consulting www.boost-consulting.com