#ifdef __cpp_lib_format std::cout << std::format("Sorted {} elements\n", data.size()); #else std::cout << "Sorted " << data.size() << " elements\n"; #endif
# Compile a simple program cl /EHsc /std:c++17 /W4 main.cpp cl /EHsc /std:c++17 /O2 /Zi main.cpp /Fe:myapp.exe For x64 (if using x86 prompt) cl /EHsc /std:c++17 /arch:AVX2 main.cpp visual c++ 2019
std::vector<int> data(1'000'000); std::generate(data.begin(), data.end(), []() return rand() % 100; ); #ifdef __cpp_lib_format std::cout <
Set environment manually:
// Parallel sort (C++17) std::sort(std::execution::par, data.begin(), data.end()); std::format("Sorted {} elements\n"