Replace clumsy template specialization with a static_assert