I have a simple struct
struct MyStruct
{
int x;
}
I have a vector of MyStruct
s.
vector<MyStruct> myStructs;
int n = 10;
for(auto i = 0; i < n; i++)
myStructs.push_back(MyStruct{.x = n - i});
How will I sort myStructs
according to member variable .x
using std::ranges
?