This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mem_fun family (for_each, bind..)
- To: lfarkas@mindmaker.hu
- Subject: Re: mem_fun family (for_each, bind..)
- From: "Gary Granger" <granger@atd.ucar.edu>
- Date: Fri, 06 Aug 1999 14:00:47 -0600
- cc: gcc@gcc.gnu.org
The draft standard I have lists the bind2nd declaration as follows:
template <class Operation, class T>
binder2nd<Operation> bind2nd(const Operation&, const T&);
It looks like the type 'double' you are passing cannot be used since it is
not constant. I replaced your reference with a pointer and it compiled and
ran with no problems:
Across the ether fly the words of Levente Farkas:
...
> void f(double& d) const { ++d; }
void f(double *d) const { ++(*d); }
...
> std::bind2nd(std::mem_fun(&A::f), d));
std::bind2nd(std::mem_fun(&A::f), &d));
> ...
> ms's compiler don't support it), but this simple example can't compile even
> on the latest egcs/gcc - 2.95!
> or am I wrong ?
If you are not sure whether this "simple example" complies with the
standard, then perhaps it is not so simple, and you should instead let the
newsgroups answer the STL question *before* asking the bug question.
gary