Tighten fixed representation static asserts

This commit is contained in:
Danny Robson 2011-08-10 21:28:44 +10:00
parent 3fa14e88e0
commit 9b049861f1

View File

@ -30,6 +30,8 @@ fixed<INT, FRAC>::fixed (integral_type val):
{
static_assert (INT > 0, "must use positive integer bits");
static_assert (FRAC > 0, "must use positive fractional bits");
static_assert (INT + FRAC == sizeof (m_value) * 8,
"underlying storage must be exactly int:frac sized");
}