C++ static_if() alternative implementation