This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15998] typo for std::mem_fun1 in include file stl_function.h
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jun 2004 13:19:42 -0000
- Subject: [Bug c++/15998] typo for std::mem_fun1 in include file stl_function.h
- References: <20040615125910.15998.matthew.j.polder@kodak.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2004-06-15 13:19 -------
Not a bug: mem_fun1 (at variance with mem_fun1_t, for instance) is not part
of the ISO Standard and has been moved to the <ext/functional> header inside
the __gnu_cxx namespace. Indeed, the below compiles for me. Thanks.
///////////
#include <functional>
#include <algorithm>
#include <vector>
#include <ext/functional>
class Apple
{
public:
void Aggregate(int);
};
void foo(const std::vector<Apple*>& apples)
{
int n = 5;
std::for_each(apples.begin(), apples.end(),
std::bind2nd(__gnu_cxx::mem_fun1<void,
Apple, int>(&Apple::Aggregate), 5));
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15998