Title
Problem with lwg DR 184 numeric_limits<bool>
Status
nad
Section
[numeric.special]
Submitter
Howard Hinnant

Created on 2006-01-29.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

[ Redmond: NAD because traps refers to values, not operations. There is no bool value that will trap. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

Change 18.2.1.5p3:

-3- The specialization for bool shall be provided as follows:

namespace std { 
   template <> class numeric_limits<bool> {
      ...
      static const bool traps = false implementation-defined;
      ...
   };
}
Date: 2015-12-17.07:21:33

I believe we have a bug in the resolution of: 184 (WP status).

The resolution spells out each member of numeric_limits<bool>. The part I'm having a little trouble with is:

static const bool traps = false;

Should this not be implementation defined? Given:

int main()
{
     bool b1 = true;
     bool b2 = false;
     bool b3 = b1/b2;
}

If this causes a trap, shouldn't numeric_limits<bool>::traps be true?

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3036
2010-10-21 18:28:33adminsetmessages: + msg3035
2006-01-29 00:00:00admincreate