fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. class foo{
  7. private:
  8. struct bar{
  9. double rng;
  10. };
  11. struct baz{
  12. bar abar;
  13. };
  14. void foobar();
  15. static bool cmp(baz a, baz b);
  16. };
  17.  
  18. bool foo::cmp(baz a, baz b){
  19. return (a.abar.rng < b.abar.rng);
  20. }
  21.  
  22. void foo::foobar(){
  23. std::vector<baz> aVec;
  24. // fill aVec
  25. std::sort(aVec.begin(), aVec.end(), cmp);
  26. }
  27.  
  28. int main() {
  29. // your code goes here
  30. return 0;
  31. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty