I have a class with an anonymous struct:
class foo {
struct {
float x;
float y;
float z;
};
};
I create two objects of this class:
obj1 = {1, 2, 3};
obj2 = {2, 3, 4};
Then I want to know if all the variables of obj2's anonymous struct are greater than the corresponding variables of the anonymous struct of obj1.
Is there an easy way to do this apart from directly comparing each pair of variables and some macro stuff?
std::tiewould not be used to check whether all of the variables are bigger. Only whether the first non-equal one is bigger.std::tieis an easy way to create a comparison operator for set of fields. But it would not work in your case as comparison onstd::tupleworks differentstructanyway? It does not make any sense