This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
Section: 17.12.2 [coroutine.syn], 19.5.2 [system.error.syn], 22.2.1 [utility.syn], 22.4.2 [tuple.syn], 22.5.2 [optional.syn], 22.6.2 [variant.syn], 20.2.2 [memory.syn], 22.11.1 [type.index.synopsis], 23.4.2 [string.syn], 23.3.2 [string.view.synop], 24.3.2 [array.syn], 24.3.3 [deque.syn], 24.3.4 [forward.list.syn], 24.3.5 [list.syn], 24.3.6 [vector.syn], 24.4.2 [associative.map.syn], 24.4.3 [associative.set.syn], 24.5.2 [unord.map.syn], 24.5.3 [unord.set.syn], 24.6.2 [queue.syn], 24.6.3 [stack.syn], 25.2 [iterator.synopsis], 26.2 [ranges.syn], 29.2 [time.syn], 31.12.4 [fs.filesystem.syn], 32.3 [re.syn], 33.4.2 [thread.syn] Status: C++20 Submitter: United States Opened: 2019-11-07 Last modified: 2021-02-25
Priority: 0
View all other issues in [coroutine.syn].
View all issues with C++20 status.
Discussion:
Addresses US 181
The spaceship operator<=> is typically not usable unless the library header <compare> is directly included by the user. Many standard library headers provide overloads for this operator. Worse, several standard classes have replaced their existing definition for comparison operators with a reliance on the spaceship operator, and existing code will break if the necessary header is not (transitively) included. In a manner similar to the mandated library headers transitively #include-ing <initializer_list> in C++11, these headers should mandate a transitive #include <compare>.
Proposed change: Add: #include <compare> to the header synopsis for each of the following headers:<array> <chrono> <coroutine> <deque> <forward_list> <filesystem> <iterator> <list> <map> <memory> <optional> <queue> <ranges> <regex> <set> <stack> <string> <string_view> <system_error> <thread> <tuple> <type_index> <unordered_map> <unordered_set> <utility> <variant> <vector>
[2019-11 Moved to Ready on Friday AM in Belfast]
Proposed resolution:
This wording is relative to N4835.
Add
#include <compare>
to the following header synopses: