T
tron.thomas
I'm using Microsoft Development Environment 2002 Version 7.0.9466 on
Windows XP Professional Service Pack 2. If I compile the following
code at maximum warning level:
#include <functional>
class SetValue : public std::unary_function<int, void>
{
public:
explicit SetValue(int& value) : m_value(value) {}
void operator() (int value) { m_value = value; }
private:
int& m_value;
};
I get the following warning:
.... warning C4512: 'SetValue' : assignment operator could not be
generated
... see declaration of 'SetValue'
I can't see anything in the declaration of this class that would
prevent the compiler from generating an assignment operator.
What is causing the warning and how can I eliminate it?
Windows XP Professional Service Pack 2. If I compile the following
code at maximum warning level:
#include <functional>
class SetValue : public std::unary_function<int, void>
{
public:
explicit SetValue(int& value) : m_value(value) {}
void operator() (int value) { m_value = value; }
private:
int& m_value;
};
I get the following warning:
.... warning C4512: 'SetValue' : assignment operator could not be
generated
... see declaration of 'SetValue'
I can't see anything in the declaration of this class that would
prevent the compiler from generating an assignment operator.
What is causing the warning and how can I eliminate it?