13 Asynchronous model [async]

13.25 Class template strand [async.strand]

13.25.1 strand constructors [async.strand.cons]

strand();

Effects: Constructs an object of class strand<Executor> that represents a unique ordered, non-concurrent state. Initializes inner_ex_ as inner_ex_().

Remarks: This overload shall not participate in overload resolution unless Executor satisfies the DefaultConstructible requirements (C++ 2014 [defaultconstructible]).

explicit strand(Executor ex);

Effects: Constructs an object of class strand<Executor> that represents a unique ordered, non-concurrent state. Initializes inner_ex_ as inner_ex_(ex).

template<class ProtoAllocator> strand(allocator_arg_t, const ProtoAllocator& a, Executor ex);

Effects: Constructs an object of class strand<Executor> that represents a unique ordered, non-concurrent state. Initializes inner_ex_ as inner_ex_(ex). A copy of the allocator argument a is used to allocate memory, if necessary, for the internal data structures of the constructed strand object.

strand(const strand& other) noexcept;

Effects: Initializes inner_ex_ as inner_ex_(other.inner_ex_).

Postconditions:

  • *this == other

  • get_inner_executor() == other.get_inner_executor()

strand(strand&& other) noexcept;

Effects: Initializes inner_ex_ as inner_ex_(std::move(other.inner_ex_)).

Postconditions:

  • *this is equal to the prior value of other

  • get_inner_executor() == other.get_inner_executor()

template<class OtherExecutor> strand(const strand<OtherExecutor>& other) noexcept;

Requires: OtherExecutor is convertible to Executor.

Effects: Initializes inner_ex_ as inner_ex_(other.inner_ex_).

Postconditions: *this == other.

template<class OtherExecutor> strand(strand<OtherExecutor>&& other) noexcept;

Requires: OtherExecutor is convertible to Executor.

Effects: Initializes inner_ex_ as inner_ex_(std::move(other.inner_ex_)).

Postconditions: *this is equal to the prior value of other.