Is there a reason to use three template parameters when a single one would be sufficient?
template <typename X>
static constexpr bool is_minimum(const X x)
{
using U = typename std::underlying_type<X>::type;
return x == std::numeric_limits<U>::min();
}
static_assert(is_minimum(Consensus::DEPLOYMENT_HEIGHTINCB), "heightincb is not minimum value for BuriedDeployment");
static_assert(is_minimum(Consensus::DEPLOYMENT_TESTDUMMY), "testdummy is not minimum value for DeploymentPos");
This seems verbose, confusing and dangerous. For example the following asserts are wrong, but don't fail:
static_assert(is_minimum<Consensus::BuriedDeployment, Consensus::BuriedDeployment, signed short>(Consensus::DEPLOYMENT_HEIGHTINCB), "heightincb is not minimum value for BuriedDeployment");
static_assert(is_minimum<Consensus::DeploymentPos, Consensus::DeploymentPos, unsigned short>(Consensus::DEPLOYMENT_TESTDUMMY), "testdummy is not minimum value for DeploymentPos");