S
Shea Martin
I have a struct like so:
struct MyStruct
{
public:
void Value( int newValue ) { mValue = newValue; }
int Value() const { return mValue; }
private:
int mValue;
};
This is a compile error on g++, as it overloads on return type. But I
think it compiles on MSVC++. I am at home now, and don't have access to
a windows/MSVC++, so I can't verify this. Can someone tell me if I am
losing my mind? I kind of like the semantics of having my get set
methods like this. I don't use g++ a lot, but if it is not std C++, or
if it won't be in the future, then I'll drop it.
~S
struct MyStruct
{
public:
void Value( int newValue ) { mValue = newValue; }
int Value() const { return mValue; }
private:
int mValue;
};
This is a compile error on g++, as it overloads on return type. But I
think it compiles on MSVC++. I am at home now, and don't have access to
a windows/MSVC++, so I can't verify this. Can someone tell me if I am
losing my mind? I kind of like the semantics of having my get set
methods like this. I don't use g++ a lot, but if it is not std C++, or
if it won't be in the future, then I'll drop it.
~S