When building cpp_redis with Microsoft Visual Studio and switching the permissive mode off (=conformance mode on) or switching the language standard to C++20 (what implicitly enabled the conformacne mode), cpp_redis no longer compiles due to an error in optional.hpp when explanding __CPP_REDIS_LOG(1, "value_or(U&& v)\n") to cpp_redis::1(...)
Error C2589 'constant': illegal token on right side of '::'
The reason is that MSVC by default sets the __cplusplus makro to 199711L even for newer language standards.
The solution is to either set an additional compiler option in the visual studio project: /Zc:__cplusplus or to update the line
if __cplusplus >= 201703L in optional.hpp to also check for _MSVC_LANG
When building cpp_redis with Microsoft Visual Studio and switching the permissive mode off (=conformance mode on) or switching the language standard to C++20 (what implicitly enabled the conformacne mode), cpp_redis no longer compiles due to an error in optional.hpp when explanding __CPP_REDIS_LOG(1, "value_or(U&& v)\n") to cpp_redis::1(...) Error C2589 'constant': illegal token on right side of '::'
The reason is that MSVC by default sets the __cplusplus makro to 199711L even for newer language standards.
The solution is to either set an additional compiler option in the visual studio project: /Zc:__cplusplus or to update the line
if __cplusplus >= 201703L in optional.hpp to also check for _MSVC_LANG