I am trying to have a class that allows implicit casting to certain built in types, like unsigned long int and since I\'m trying to do this as correct as possible (this is my fi
The function signature does not match the function definition.
operator unsigned long int () const;
and
CustomizedInt::operator unsigned long() { ... }
^^^
const missing
In this case you should mark the conversion operator as const
since it doesn't affect the internal state of the object.
Also, use constructor initialization lists to initialize your member variables.
CustomizedInt::CustomizedInt()
: data()
{
}
CustomizedInt::CustomizedInt(int input)
: data(input)
{
}