It sounds like you're trying to merge to kinds of objects into one: one that has an intuitively understandable concept of summation, and another that doesn't. Still they are related somehow to the point that you want to have them inside a common ... container.
I'd suggest to separate your 'additive data' from the 'user data' like this:
class MyValues {
int mx;
float my;
public:
MyValues(int x, float y) : mx(x), my(y) {}
MyValues(const MyValues& other) : mx(other.mx), my(other.my) {}
MyValues& operator +=(const MyValues& other) {
mx += other.mx;
my += other.my;
return *this;
}
MyValues operator+(const MyValues& other) const {
return MyValues(*this)+=other;
}
};
class MyData {
int mdata;
public:
MyData(int data) : mdata(data) {}
MyData(const MyData& other) : mdata(other.mdata) {}
void set(int data) { mdata = data; }
int data const ( return mdata; }
};
class MyClass {
MyValues mvalues;
MyData mdata;
public:
MyClass(int x, float y, int data) : mvalues(x, y), mdata(data) {}
void addValues(const MyClass& other) {
mvalues += other.mvalues;
}
};
This allows you to separate user data functionality from numerical data functionality.