#include <iostream>
int main()
{
if constexpr (0)
{
std::cout << "Section Compiled Out" << " ";
}
else
{
std::cout << "Section Compiled In" << " ";
}
std::cout << std::endl;
return 0;
}
// Output: Section Compiled In
References:https://en.wikipedia.org/wiki/C%2B%2B17
https://tech.io/playgrounds/2205/7-features-of-c17-that-will-simplify-your-code/constexpr-if
No comments:
Post a Comment