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++14 status.

2081.Allocator requirements should includeCopyConstructible

Section: 16.4.4.6[allocator.requirements]Status:C++14Submitter: Jonathan WakelyOpened: 2011-08-30Last modified: 2016-01-28

Priority:Not Prioritized

View otheractive issues in [allocator.requirements].

View all otherissues in [allocator.requirements].

View all issues withC++14 status.

Discussion:

As discussed in c++std-lib-31054 and c++std-lib-31059, theAllocatorrequirements implicitly requireCopyConstructible becausea.select_on_container_copy_construction() andcontainer.get_allocator() both return a copy by value, but therequirement is not stated explicitly anywhere.

In order to clarify that allocators cannot have 'explicit' copyconstructors, the requirements should includeCopyConstructible.

[2012, Kona]

Move to Ready.

[2012, Portland: applied to WP]

Proposed resolution:

This wording is relative to the FDIS.

  1. Change Table 28 — Allocator requirements in 16.4.4.6[allocator.requirements]:

    Table 28 — Allocator requirements
    ExpressionReturn typeAssertion/note pre-/post-conditionDefault
    X a1(a);
    X a1 = a;
    Shall not exit via an exception.
    post:a1 == a
    X a1(move(a));
    X a1 = move(a);
    Shall not exit via an exception.
    post:a1 equals the prior value
    ofa.
  2. Change 16.4.4.6[allocator.requirements] paragraph 4:

    An allocator typeX shall satisfy the requirements ofCopyConstructible (16.4.4.2[utility.arg.requirements]). TheX::pointer,X::const_pointer,X::void_pointer, andX::const_void_pointer types shall satisfy the requirements ofNullablePointer (16.4.4.4[nullablepointer.requirements]). No constructor, comparison operator, copy operation, move operation, or swap operation on these types shall exit via an exception.X::pointer andX::const_pointer shall also satisfy the requirements for a random access iterator (24.3[iterator.requirements]).


[8]ページ先頭

©2009-2026 Movatter.jp