use static_assert and add config check