Files
cppdraft_translate/cppdraft/cmp/common.md
2025-10-25 03:02:53 +03:00

46 lines
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[cmp.common]
# 17 Language support library [[support]](./#support)
## 17.12 Comparisons [[cmp]](cmp#common)
### 17.12.3 Class template common_comparison_category [cmp.common]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L5288)
The type common_comparison_category provides an alias for
the strongest comparison category
to which all of the template arguments can be converted[.](#1.sentence-1)
[*Note [1](#note-1)*:
A comparison category type is stronger than another if
they are distinct types and an instance of the former
can be converted to an instance of the latter[.](#1.sentence-2)
— *end note*]
[🔗](#lib:common_comparison_category)
`template<class... Ts>
struct common_comparison_category {
using type = see below;
};
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L5307)
*Remarks*: The member [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4The typedef specifier[dcl.typedef]") type denotes
the common comparison type ([[class.spaceship]](class.spaceship "11.10.3Three-way comparison")) of Ts...,
the expanded parameter pack, orvoid if any element of Ts is not a comparison category type[.](#2.sentence-1)
[*Note [2](#note-2)*:
This is std::strong_ordering if the expansion is empty[.](#2.sentence-2)
— *end note*]