Class:
Class: private: ... vector words; vector< list > vints; public: myFunction(...)
With lambdas:
vints[i].sort([&words](int i, int j) { return words[i] < words[j]; });
With std::bind:
std::bind
#include //... { using namespace std::placeholders; vints[i].sort(std::bind(&myClass::sortFunc, this, _1, _2)); }