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