Skip to content

Commit

Permalink
Add clarifying example for tagged construction (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcoe authored Jan 23, 2025
1 parent 9a91f53 commit 00c3edd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions DRAFT.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ should not be considered in isolation.

* Remove noexcept specification from `operator<=>` for `indirect`.

* Add a second clarifying example to tagged constructors explanatory text.

## Changes in R12

* Fix `indirect` synopsis to include `explicit` on the default constructor.
Expand Down Expand Up @@ -552,10 +554,15 @@ library’s use of tagged constructors in `optional`, `any` and `variant`.
Without `in_place_t` the constructor of `indirect` would not be able to
construct an owned object using the owned object’s allocator-extended
constructor. `indirect(std::in_place, std::allocator_arg, alloc, args)`
unambiguously constructs an `indirect` with a default constructed allocator and
an owned object constructed with an allocator extended constructor taking an
constructs an `indirect` with a default-constructed allocator and
an owned object constructed with an allocator-extended constructor taking an
allocator `alloc` and constructor arguments `args`.

For comparison, `indirect(std::allocator_arg, a, std::in_place, std::allocator_arg, alloc, args)`
constructs an `indirect` with an allocator `a` and an owned object
constructed with an allocator-extended constructor taking an allocator
`alloc` and constructor arguments `args`.

## Single-argument constructors

In line with `optional` and `variant`, we add single-argument constructors to both
Expand Down

0 comments on commit 00c3edd

Please sign in to comment.