boost-ext / te

C++17 Run-time Polymorphism (Type Erasure) library
451 stars 38 forks source link

REQUIRED Macro not work in vs19 c++17 #43

Closed lty123456 closed 5 months ago

lty123456 commented 5 months ago

incorrect code: #if not defined(REQUIRES)

desc: #if not defined() work incorrect in vs2019 cmake c++17, detail:https://developercommunity.visualstudio.com/t/if-not-defined-work-incorrect-in-vs-201/10643213

it's seems #if not defined() is not c++ standard, see: https://en.cppreference.com/w/cpp/preprocessor use #ifndef may better

krzysztof-jusiak commented 5 months ago

AFAIR it's MSVC not being complaint with the standard and only defining and/not/or with the following include:

#include <iso646.h>  // and, or, not, ...
#if not defined(...)

is the same as

#if !defined(...)

and it's part of the standard.

We can change it though to ! ifndef to make msvc happy or include ios646.h if available. I'll push the fix with one of the above.