Modernes C++ programmieren

Okt 23, 2024

lst-0817-godb.cpp

//#(compile) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/EjT7nPPv7 
std::vector v{0,1,3,5,7,9,2,4,6,8};
std::sort(v.begin(), v.end());
for(int i:v) std::cout << i << ' ';
std::cout << '\n';
// oder mit einer Range:
std::ranges::sort(v);
for(int i:v) std::cout << i << ' ';
std::cout << '\n';