[coroutine.handle.noop]

# 17 Language support library [[support]](./#support)

## 17.13 Coroutines [[support.coroutine]](support.coroutine#coroutine.handle.noop)

### 17.13.5 No-op coroutines [[coroutine.noop]](coroutine.noop#coroutine.handle.noop)

#### 17.13.5.2 Class coroutine_handle<noop_coroutine_promise> [coroutine.handle.noop]

#### [17.13.5.2.1](#general) General [[coroutine.handle.noop.general]](coroutine.handle.noop.general)

[ð](#lib:coroutine_handle%3cnoop_coroutine_promise%3e)

namespace std {template<>struct coroutine_handle<noop_coroutine_promise>{// [[coroutine.handle.noop.conv]](#conv "17.13.5.2.2 Conversion"), conversionconstexpr operator coroutine_handle<>() const noexcept; // [[coroutine.handle.noop.observers]](#observers "17.13.5.2.3 Observers"), observersconstexpr explicit operator bool() const noexcept; constexpr bool done() const noexcept; // [[coroutine.handle.noop.resumption]](#resumption "17.13.5.2.4 Resumption"), resumptionconstexpr void operator()() const noexcept; constexpr void resume() const noexcept; constexpr void destroy() const noexcept; // [[coroutine.handle.noop.promise]](#promise "17.13.5.2.5 Promise access"), promise access noop_coroutine_promise& promise() const noexcept; // [[coroutine.handle.noop.address]](#address "17.13.5.2.6 Address"), addressconstexpr void* address() const noexcept; private: coroutine_handle(*unspecified*); void* ptr; // *exposition only*};}

#### [17.13.5.2.2](#conv) Conversion [[coroutine.handle.noop.conv]](coroutine.handle.noop.conv)

[ð](#lib:operator_coroutine_handle%3c%3e,coroutine_handle%3cnoop_coroutine_promise%3e)

`constexpr operator coroutine_handle<>() const noexcept;
`

[1](#conv-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6206)

*Effects*: Equivalent to: return coroutine_handle<>​::​from_address(address());

#### [17.13.5.2.3](#observers) Observers [[coroutine.handle.noop.observers]](coroutine.handle.noop.observers)

[ð](#lib:operator_bool,coroutine_handle%3cnoop_coroutine_promise%3e)

`constexpr explicit operator bool() const noexcept;
`

[1](#observers-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6219)

*Returns*: true[.](#observers-1.sentence-1)

[ð](#lib:done,coroutine_handle%3cnoop_coroutine_promise%3e)

`constexpr bool done() const noexcept;
`

[2](#observers-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6230)

*Returns*: false[.](#observers-2.sentence-1)

#### [17.13.5.2.4](#resumption) Resumption [[coroutine.handle.noop.resumption]](coroutine.handle.noop.resumption)

[ð](#lib:operator(),coroutine_handle%3cnoop_coroutine_promise%3e)

`constexpr void operator()() const noexcept;
constexpr void resume() const noexcept;
constexpr void destroy() const noexcept;
`

[1](#resumption-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6247)

*Effects*: None[.](#resumption-1.sentence-1)

[2](#resumption-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6251)

*Remarks*: If noop_coroutine_handle is converted to coroutine_handle<>,
calls to operator(), resume and destroy on that handle
will also have no observable effects[.](#resumption-2.sentence-1)

#### [17.13.5.2.5](#promise) Promise access [[coroutine.handle.noop.promise]](coroutine.handle.noop.promise)

[ð](#lib:promise,coroutine_handle%3cnoop_coroutine_promise%3e)

`noop_coroutine_promise& promise() const noexcept;
`

[1](#promise-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6266)

*Returns*: A reference to the promise object associated with this
coroutine handle[.](#promise-1.sentence-1)

#### [17.13.5.2.6](#address) Address [[coroutine.handle.noop.address]](coroutine.handle.noop.address)

[ð](#lib:address,coroutine_handle%3cnoop_coroutine_promise%3e)

`constexpr void* address() const noexcept;
`

[1](#address-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6280)

*Returns*: ptr[.](#address-1.sentence-1)

[2](#address-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6284)

*Remarks*: A noop_coroutine_handle's ptr is always a
non-null pointer value[.](#address-2.sentence-1)
