use static assert instead of tricks