Boost logo

Boost Users :

Subject: Re: [Boost-users] [mpl] bind help sought
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-02-23 02:51:53


Manfred Doudar wrote:

>
> Question is, what goes in at XXX above?
>
> I was thinking something along the lines of:
>
> boost::mpl::bind<boost::mpl::_1>
>
> ..but well, that doesn't work.
>
>
> All help appreciated.

If you're in the position to use tag dispatching, one idea would be to
update Func to

struct Func
{
  typedef void result_type;

  template <typename U, typename T>
  result_type
  operator()(U& u, T ) const
  {}

};

and the call to

boost::mpl::for_each<vec>( boost::bind( boost::ref(f), instance, _1 ) );

which compiles on my system.

Cheers,

Rutger


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net