Use variadic macros in static assert to make use easier.

Add warning suppression for GCC.
Minor doc fix.
Fixes #5810.
Fixes #7242.
Fixes #7966.

[SVN r82886]
This commit is contained in:
John Maddock
2013-02-14 18:31:33 +00:00
parent ce9e800db8
commit 2993231dad
3 changed files with 62 additions and 16 deletions
+4 -4
View File
@@ -151,10 +151,10 @@ using something like this:
class myclass
{
private:
BOOST_STATIC_ASSERT((std::numeric_limits<UnsignedInt>::digits >= 16)
&& std::numeric_limits<UnsignedInt>::is_specialized
&& std::numeric_limits<UnsignedInt>::is_integer
&& !std::numeric_limits<UnsignedInt>::is_signed);
BOOST_STATIC_ASSERT_MSG(std::numeric_limits<UnsignedInt>::is_specialized, "myclass can only be specialized for types with numeric_limits support.");
BOOST_STATIC_ASSERT_MSG(std::numeric_limits<UnsignedInt>::digits >= 16, "Template argument UnsignedInt must have at least 16 bits precision.")
BOOST_STATIC_ASSERT_MSG(std::numeric_limits<UnsignedInt>::is_integer, "Template argument UnsignedInt must be an integer.");
BOOST_STATIC_ASSERT_MSG(!std::numeric_limits<UnsignedInt>::is_signed, "Template argument UnsignedInt must not be signed.");
public:
/* details here */
};