Movatterモバイル変換


[0]ホーム

URL:



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

2805.void and reference type alternatives invariant,variant<> andindex()

Section: 22.6[variant], 22.6.3[variant.variant], 22.6.3.2[variant.ctor]Status:ResolvedSubmitter: SwitzerlandOpened: 2016-11-10Last modified: 2020-09-06

Priority:Not Prioritized

View all issues withResolved status.

Discussion:

Addresses CH 3, CH 4, CH 5, CH 6, CH 8

  1. variant allows reference types as alternatives;optional explicitly forbids to be instantiated for reference types. This is inconsistent.

  2. variant<int, void> should be as usable asvariant<int>.

  3. variant<> should not have anindex() function.

  4. Clarify the intended behavior ofvariant for alternative types that are references.

  5. Clarifyvariant construction.

Proposed change:

  1. Consider allowing reference types for both or none.

  2. Consider specifying a specialization forvariant<>like:

    template<> class variant<> { public:   variant() = delete;   variant(const variant&) = delete;   variant& operator=(variant const&) = delete;};
  3. Add a respective note.

  4. Add a note thatvariant<> cannot be constructed.

[Issues Telecon 16-Dec-2016]

Resolved by the adoption ofP0501R0.

Proposed resolution:


[8]ページ先頭

©2009-2026 Movatter.jp