Fix integer.hpp so a compiler error is generated when the number of bits requested is greater than the max available.

Added new tests to catch this case.

[SVN r78307]
This commit is contained in:
John Maddock
2012-05-02 17:10:20 +00:00
parent 1898e66238
commit 90f779a9a3
8 changed files with 71 additions and 13 deletions

8
test/fail_int_exact.cpp Normal file
View File

@@ -0,0 +1,8 @@
// Copyright John Maddock 2012.
// Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/integer.hpp>
typedef boost::int_t<sizeof(boost::intmax_t)*CHAR_BIT + 1>::exact fail_int_exact;