std::sort アルゴリズムについて質問があります。ここに私のテストコードがあります:
struct MyTest
{
int m_first;
int m_second;
MyTest(int first = 0, int second = 0) : m_first(first), m_second(second)
{
}
};
int main(int argc,char *argv[])
{
std::vector<MyTest> myVec;
for(int i = 0; i < 10; ++i)
{
myVec.push_back(MyTest(i, i + 1));
}
//Sort the vector in descending order on m_first without using stand alone function or functors
return 0;
}
m_firstスタンドアロンの関数やファンクターを使用せずに変数のベクトルをソートすることは可能ですか? また、ブーストを使用していないことに注意してください。