sort(mMyClassVector.begin(), mMyClassVector.end(),
[](const MyClass & a, const MyClass & b)
{
return a.mProperty > b.mProperty;
});
Örnek sınıfını bağlama yerine özel sınıfları sıralamak için bir lambda işlevi kullanmak istiyorum. Bu boost::bind(&MyApp::myMethod, this, _1, _2)
ile çalışıyorBir lambda ile nasıl sıralanır?
error C2564: 'const char *' : a function-style conversion to a built-in type can only take one argument
: Ancak, kod yukarıdaki hata verir.
Bu tür vektör nedir? – JaredPar
Ne tür "mProperty" nedir? – wilhelmtell
Vektör, bir tamsayı ve iki dizeyi içeren bir yapıdadır. Burada bir tamsayı var. – BTR