I\'ve noticed strange behavior of static_assert:
#include
template struct Vec
{
static_
Everything is not 1,2,3,4 (for which specific specializations exist) will go into the "master" definition, that have to assert for every value of D it will be called.
So you need an expression that contains D and that is always false, to cause the compiler to evaluate it in dependency of D
If you just use 0, it will be anymore dependent and the compiler will evaluate as it matches during parsing, causing the assertion to always take place. Even if it will not be the class you will instantiate.