3 ms·
Disaster? Just because it introduces a scope? Please elaborate. A scope is the right thing to do, every other {} introduce a scope, so if this wouldn't have bee
by jenadine 3y ago
Disaster? Just because it introduces a scope? Please elaborate. A scope is the right thing to do, every other {} introduce a scope, so if this wouldn't have been consistent with the normal 'if' that would have been extra confusing.
Maybe you'd like to do something like:
template<typename T>
struct ABC {
int x;
int y;
if constexpr (is_3d<T>) {
int z;
}
};
But yeah, that's not what if constexpr does.