|
Boost Users : |
Subject: Re: [Boost-users] [Q] error with shared_ptr, for_each, boost::mem_fn
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-24 20:42:04
AMDG
V S P wrote:
> struct A: public enable_shared_from_this<A>
> {
> static void myfunc(const A* in);
> };
>
> for_each (v.begin(),v.end(), boost::mem_fn(&A::myfunc));
>
A::myfunc is a static member function, so mem_fn doesn't work.
If you declare it as a non-static member
void myfunc() const;
it works.
In Christ,
Steven Watanabe
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