You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: