This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14422] New: GCC wont recognize mem_fun1_ref
- From: "tron dot thomas at verizon dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 23:44:54 -0000
- Subject: [Bug c++/14422] New: GCC wont recognize mem_fun1_ref
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I receive the error:
`mem_fun1_ref' undeclared in namespace `std'
When compiling the following code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
class Value
{
public:
Value(int nValue) : m_nValue(nValue) {}
void Change(int nValue) { std::cout << (m_nValue *= nValue) << "\n"; }
private:
int m_nValue;
};
int main()
{
std::vector<Value> values;
values.push_back(Value(1));
values.push_back(Value(2));
values.push_back(Value(3));
values.push_back(Value(4));
values.push_back(Value(5));
std::for_each(values.begin(), values.end(),
std::bind2nd(std::mem_fun1_ref(&Value::Change), 2));
return 0;
}
This code compiles and runs successfully when built with the Borland compiler
--
Summary: GCC wont recognize mem_fun1_ref
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tron dot thomas at verizon dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14422