Title
<coroutine> is freestanding, but uses std::hash which is not
Status
new
Section
[coroutine.syn]
Submitter
Jonathan Wakely

Created on 2021-12-17.00:00:00 last changed 3 weeks ago

Messages

Date: 2025-11-11.14:48:16

Proposed resolution:

This wording is relative to ISO/IEC 14882:2020(E).

  1. Modify [coroutine.handle.hash] as indicated:
    template<class P> struct hash<coroutine_handle<P>>;
    

    -1- The specialization is enabled ([unord.hash]) in a hosted implementation.

Date: 2025-11-15.00:00:00

[ 2025-11-11; Jonathan adds wording for C++20. ]

This wording would resolve the defect for C++20, but the issue should be closed as Resolved in C++23.

Date: 2022-01-15.00:00:00

[ 2022-01-30; Reflector poll ]

Set priority to 3 after reflector poll. Would be resolved by P1642 for C++23, but it's still a defect in C++20.

Date: 2021-12-17.00:00:00

The <coroutine> header is required for freestanding implementations, but it defines a specialization of std::hash, which is not required for freestanding implementations.

Presumably we should make the std::hash specialization conditionally present.

History
Date User Action Args
2025-11-11 14:48:16adminsetmessages: + msg15725
2025-11-11 14:48:16adminsetmessages: + msg15724
2022-01-30 17:05:36adminsetmessages: + msg12325
2021-12-17 00:00:00admincreate