fork download
  1.  
  2. void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
  3. {
  4. auto start = vecc_to_sort.begin();
  5. auto finish = vecc_to_sort.end();
  6.  
  7. unsigned int d = vecc_to_sort.size()/2; //
  8.  
  9. for(; d > 0; d/=2)
  10. {
  11. for(auto i = (start); i < (finish); ++i)
  12. {
  13. for(auto j = i; j < (finish - d); j += d)
  14. {
  15. if((*j > *(j+d) == ascending_order))
  16. std::swap(*j,*(j+d));
  17. }
  18. }
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:16: error: variable or field 'sort' declared void
 void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
                ^
prog.cpp:2:11: error: 'vector' is not a member of 'std'
 void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
           ^
prog.cpp:2:23: error: 'T' was not declared in this scope
 void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
                       ^
prog.cpp:2:27: error: 'vecc_to_sort' was not declared in this scope
 void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
                           ^
prog.cpp:2:41: error: expected primary-expression before 'bool'
 void sort(std::vector<T> &vecc_to_sort, bool ascending_order)
                                         ^
stdout
Standard output is empty