Re: mem_fun vs mem_fun_ref
From: Ioannis Vranos (ivr_at_remove.this.grad.com)
Date: 03/17/05
- Next message: rahul.batra_at_gmail.com: "Efficiency Issue - true or false?"
- Previous message: Ioannis Vranos: "Re: mem_fun vs mem_fun_ref"
- In reply to: Ioannis Vranos: "Re: mem_fun vs mem_fun_ref"
- Next in thread: Pete Becker: "Re: mem_fun vs mem_fun_ref"
- Reply: Pete Becker: "Re: mem_fun vs mem_fun_ref"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Mar 2005 18:28:43 +0200
However this compiles:
> #include <vector>
> #include <algorithm>
> #include <functional>
>
>
> class B {};
> class C {};
>
> class A
> {
> public:
virtual C foo(const B) const { return C(); }
> };
>
>
>
> int main()
> {
> using namespace std;
>
> A obj;
> A &a = obj;
>
> vector<B> in(42);
>
> vector<C> out(in.size());
>
> transform(in.begin(), in.end(), out.begin(),
> bind1st(mem_fun_ref(&A::foo), obj) );
> }
Isn't there any way to maintain the reference argument in foo?
-- Ioannis Vranos http://www23.brinkster.com/noicys
- Next message: rahul.batra_at_gmail.com: "Efficiency Issue - true or false?"
- Previous message: Ioannis Vranos: "Re: mem_fun vs mem_fun_ref"
- In reply to: Ioannis Vranos: "Re: mem_fun vs mem_fun_ref"
- Next in thread: Pete Becker: "Re: mem_fun vs mem_fun_ref"
- Reply: Pete Becker: "Re: mem_fun vs mem_fun_ref"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|