Title
exception_ptr should support contextual conversion to bool
Status
resolved
Section
[propagation]
Submitter
Daniel Krügler

Created on 2007-06-06.00:00:00 last changed 170 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In section [propagation] insert a new paragraph between p.5 and p.6:

An object e of type exception_ptr can be contextually converted to bool. The effect shall be as if e != exception_ptr() had been evaluated in place of e. There shall be no implicit conversion to arithmetic type, to enumeration type or to pointer type.

Date: 2010-10-21.18:28:33

Rationale:

Solved by N3073.

Date: 2010-03-14.00:00:00

[ 2010-03-14 Howard adds: ]

We moved N3073 to the formal motions page in Pittsburgh which should obsolete this issue. I've moved this issue to NAD Editorial, solved by N3073.

Date: 2010-10-21.18:28:33

[ 2009 Santa Cruz: ]

Move to Ready. Note to editor: considering putting in a cross-reference to [conv], paragraph 3, which defines the phrase "contextually converted to bool".

Date: 2011-04-30.23:09:42

As of N2857 [propagation] p.5, the implementation-defined type exception_ptr does provide the following ways to check whether it is a null value:

void f(std::exception_ptr p) {
  p == nullptr;
  p == 0;
  p == exception_ptr();
}

This is rather cumbersome way of checking for the null value and I suggest to require support for evaluation in a boolean context like so:

void g(std::exception_ptr p) {
  if (p) {}
  !p;
}
History
Date User Action Args
2010-11-19 19:04:45adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg879
2010-10-21 18:28:33adminsetmessages: + msg878
2010-10-21 18:28:33adminsetmessages: + msg877
2010-10-21 18:28:33adminsetmessages: + msg876
2007-06-06 00:00:00admincreate