fork download
  1. #include <vector>
  2. #include <functional>
  3. #include <algorithm>
  4.  
  5. struct ptr_comparer {
  6. template<class Object>
  7. bool operator()(const Object* first, const Object* second) const {
  8. return std::less<Object>()(*first, *second);
  9. }
  10. };
  11.  
  12. int main() {
  13. std::vector<int*> data_str;
  14. std::sort(data_str.begin(), data_str.end(), ptr_comparer());
  15. }
Success #stdin #stdout 0.01s 2676KB
stdin
Standard input is empty
stdout

Standard output is empty