Opened 10 years ago

Closed 10 years ago

#7966 closed Bugs (fixed)

static_assert: doc: nitpicking

Reported by: Akim Demaille <akim.demaille@…> Owned by: John Maddock
Milestone: To Be Determined Component: static_assert
Version: Boost 1.52.0 Severity: Cosmetic
Keywords: doc Cc:

Description

The following patch is really cosmetic. The doc reads:

   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);

It does not make much sense, imho, to check is_specialized _after_ having already use digits. I know all this is meant to fail, but it makes more sense to check is_specialized first, and the number of digits after we know this is an unsigned int. (FWIW, I would use four assertions, to facilitate the understanding of what failed).

Thanks for Boost, I'm a happy user!

Attachments (1)

static-assert-doc.patch (1.7 KB ) - added by Akim Demaille <akim.demaille@…> 10 years ago.
doc patch

Download all attachments as: .zip

Change History (2)

by Akim Demaille <akim.demaille@…>, 10 years ago

Attachment: static-assert-doc.patch added

doc patch

comment:1 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [82886]) Use variadic macros in static assert to make use easier. Add warning suppression for GCC. Minor doc fix. Fixes #5810. Fixes #7242. Fixes #7966.

Note: See TracTickets for help on using tickets.