From 9b049861f1aa30d629b50c1420b801be16d11fc7 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 10 Aug 2011 21:28:44 +1000 Subject: [PATCH] Tighten fixed representation static asserts --- fixed.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fixed.cpp b/fixed.cpp index 4514f559..0c1af302 100644 --- a/fixed.cpp +++ b/fixed.cpp @@ -30,6 +30,8 @@ fixed::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"); }