MSVC does not properly define __cplusplus
, unless one specifies the /Z:cplusplus
switch.
Now, in a library I'm maintaining, I have some conditional compilation logic such as:
#if __cplusplus >= 201703L
etc. etc.
#endif
Now - as I intend my code to be portable, and MSVC is the popular compiler on Windows - should I "cater" to it by replacing that condition with:
#if (__cplusplus >= 201703L) || (_MSVC_LANG >= 201703L)
etc. etc.
#endif
or should I use the standard facility, and expect library users to use /Z:cplusplus
?