$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-13 10:32:45
From: <sgregory_at_[hidden]>
> I'm trying to write code portable to SunC++ (5.2) and MSC++ (6.0).
> And am having problems with std::mem_fun or boost::mem_fn with a
> class member function that returns void.
>
> // pseudo-example code
> struct A {
> void func(const double);
> };
> std::for_each(arr.begin(), arr.end(),
> std::bind1st(std::mem_fun(&A::func),&arr)); // fails
> std:;for_each(arr.begin(), arr.end(),
> std::bind1st(boost::mem_fn(&A::func),&arr)); // also
> fails
>
> Should using boost::mem_fn fix the 'void return' problem of MS?
Unfortunately not (yet.) Even
std::for_each(arr.begin(), arr.end(), boost::bind(&A::func, &a));
will currently fail for a 'void' return on MSVC.
-- Peter Dimov Multi Media Ltd.