CPlusPlusHowToProgram11e
CPlusPlusHowToProgram11e copied to clipboard
Code repository for our textbook C++ How to Program: An Objects-Natural Approach, 11/e
std::cout.flags() returns std::ios_base::fmtflags, it can't be formatted by std::format. we need cast it. ``` std::format("flags value: {}\n", static_cast(std::cout.flags())) ```
``` g++-13 -std=c++20 async.cpp -o async /usr/bin/ld: /tmp/ccBfmpl3.o: in function `id[abi:cxx11]()': async.cpp:(.text+0x8c): undefined reference to `std::basic_ostream& std::operator
the following codes can't compile: ``` const std::array ints1{1, 2, 3, 4, 5}; // has random-access iterators auto result1{customDistance(ints1.begin(), ints1.end())}; template auto customDistance(Iterator begin, Iterator end) { // for random-access...