Title
std::function should use nullptr_t instead of "unspecified-null-pointer-type"
Status
cd1
Section
[func.wrap.func]
Submitter
Daniel Krügler

Created on 2008-01-10.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [function.objects], header <functional> synopsis replace:

template<class R, class... ArgTypes>
  bool operator==(const function<R(ArgTypes...)>&, unspecified-null-pointer-type nullptr_t);
template<class R, class... ArgTypes>
  bool operator==(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>&);
template<class R, class... ArgTypes>
  bool operator!=(const function<R(ArgTypes...)>&, unspecified-null-pointer-type nullptr_t);
template<class R, class... ArgTypes>
  bool operator!=(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>&);

In the class function synopsis of [func.wrap.func] replace

function(unspecified-null-pointer-type nullptr_t);
...
function& operator=(unspecified-null-pointer-type nullptr_t);

In [func.wrap.func], "Null pointer comparisons" replace:

template <class R, class... ArgTypes>
  bool operator==(const function<R(ArgTypes...)>&, unspecified-null-pointer-type nullptr_t);
template <class R, class... ArgTypes>
  bool operator==(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>&);
template <class R, class... ArgTypes>
  bool operator!=(const function<R(ArgTypes...)>&, unspecified-null-pointer-type nullptr_t);
template <class R, class... ArgTypes>
  bool operator!=(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>&);

In [func.wrap.func.con], replace

function(unspecified-null-pointer-type nullptr_t);
...
function& operator=(unspecified-null-pointer-type nullptr_t);

In [func.wrap.func.nullptr], replace

template <class R, class... ArgTypes>
  bool operator==(const function<R(ArgTypes...)>& f, unspecified-null-pointer-type nullptr_t);
template <class R, class... ArgTypes>
  bool operator==(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>& f);

and replace

template <class R, class... ArgTypes>
  bool operator!=(const function<R(ArgTypes...)>& f, unspecified-null-pointer-type nullptr_t);
template <class R, class... ArgTypes>
  bool operator!=(unspecified-null-pointer-type nullptr_t , const function<R(ArgTypes...)>& f);
Date: 2008-01-10.00:00:00

N2461 already replaced in [func.wrap.func] it's originally proposed (implicit) conversion operator to "unspecified-bool-type" by the new explicit bool conversion, but the inverse conversion should also use the new std::nullptr_t type instead of "unspecified-null-pointer- type".

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3713
2008-01-10 00:00:00admincreate