Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++17 status.

2401.std::function needs morenoexcept

Section: 22.10.17.3[func.wrap.func]Status:C++17Submitter: Stephan T. LavavejOpened: 2014-06-14Last modified: 2017-07-30

Priority:0

View all otherissues in [func.wrap.func].

View all issues withC++17 status.

Discussion:

There are two issues here:

  1. std::function's constructor fromnullptr_t is marked asnoexcept, but its assignment operator fromnullptr_t isn't. This assignment can and should be marked asnoexcept.

  2. std::function's comparisons withnullptr_t are marked asnoexcept in two out of three places.

[2014-06-16 Rapperswil]

Move to Ready

Proposed resolution:

This wording is relative to N3936.

  1. Change 22.10[function.objects] p2, header<functional> synopsis, as indicated:

    namespace std {  […]// 20.9.11 polymorphic function wrappers:  […]  template<class R, class... ArgTypes>  bool operator==(const function<R(ArgTypes...)>&, nullptr_t)noexcept;  template<class R, class... ArgTypes>  bool operator==(nullptr_t, const function<R(ArgTypes...)>&)noexcept;  template<class R, class... ArgTypes>  bool operator!=(const function<R(ArgTypes...)>&, nullptr_t)noexcept;  template<class R, class... ArgTypes>  bool operator!=(nullptr_t, const function<R(ArgTypes...)>&)noexcept;  […]}
  2. Change 22.10.17.3[func.wrap.func], class templatefunction synopsis, as indicated:

    […]// 20.9.11.2.1, construct/copy/destroy:[…]function& operator=(nullptr_t)noexcept;[…]
  3. Change 22.10.17.3.2[func.wrap.func.con] before p16 as indicated:

    function& operator=(nullptr_t)noexcept;

[8]ページ先頭

©2009-2026 Movatter.jp