This is a follow-up question to 2043381.
Consider the following:
struct DataBundle
{
std::string name;
int age;
DataBundle() : age(0) {}
DataBundle(const std::string& name, int age)
: name(name), age(age) {}
void swap(DataBundle& rhs)
{name.swap(rhs.name); std::swap(age, rhs.age);}
DataBundle& operator=(DataBundle rhs) {swap(rhs); return *this;}
bool operator==(const DataBundle& rhs) const
{return (name == rhs.name) && (age == rhs.age);}
bool operator!=(const DataBundle& rhs) const {return !(*this == rhs);}
}
In the spirit of rule #41 of C++ Coding Standards (see related article), would this still be considered a behaviorless aggregate? I don't like writing "dumb" classes with mostly getters/setters, and would rather use an all-public struct to indicate it's just a "bundle-o-data". But in the above example, am I at the point where I should make DataBundle a class with getters/setters?