programming-with-cpp20
programming-with-cpp20 copied to clipboard
Fixed the compiler error of C2664
Env Viual studio 17 2022, cmake 3.30.4
After using the cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_CXX_COMPILER=cl to genetor the build directory and sln file.
Complie will meet this error
error C2664: 'auto std::make_format_args<std::format_context,const std::string,double,const T,const T>(const std::string &,double &,const T &,const T &)': cannot convert argument 2 from 'double' to 'double &
Add the menber function to solve this problem.
Hello @007havegone,
Thanks for the fix! I'd like to think a moment about what to do here. While your fix is great and correct, the source code presented in the book and the explanation no longer match.
Andreas