[compare.syn] # 17 Language support library [[support]](./#support) ## 17.12 Comparisons [[cmp]](cmp#compare.syn) ### 17.12.1 Header synopsis [compare.syn] [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L4783) The header specifies types, objects, and functions for use primarily in connection with the [three-way comparison operator](expr.spaceship "7.6.8 Three-way comparison operator [expr.spaceship]")[.](#1.sentence-1) [🔗](#lib:is_eq) // all freestandingnamespace std {// [[cmp.categories]](cmp.categories "17.12.2 Comparison category types"), comparison category typesclass partial_ordering; class weak_ordering; class strong_ordering; // named comparison functionsconstexpr bool is_eq (partial_ordering cmp) noexcept { return cmp == 0; }constexpr bool is_neq (partial_ordering cmp) noexcept { return cmp != 0; }constexpr bool is_lt (partial_ordering cmp) noexcept { return cmp < 0; }constexpr bool is_lteq(partial_ordering cmp) noexcept { return cmp <= 0; }constexpr bool is_gt (partial_ordering cmp) noexcept { return cmp > 0; }constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; }// [[cmp.common]](cmp.common "17.12.3 Class template common_­comparison_­category"), common comparison category typetemplatestruct common_comparison_category {using type = *see below*; }; templateusing common_comparison_category_t = typename common_comparison_category::type; // [[cmp.concept]](cmp.concept "17.12.4 Concept three_­way_­comparable"), concept [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]")templateconcept three_way_comparable = *see below*; templateconcept three_way_comparable_with = *see below*; // [[cmp.result]](cmp.result "17.12.5 Result of three-way comparison"), result of three-way comparisontemplate struct compare_three_way_result; templateusing compare_three_way_result_t = typename compare_three_way_result::type; // [[comparisons.three.way]](comparisons.three.way "22.10.8.8 Class compare_­three_­way"), class compare_three_waystruct compare_three_way; // [[cmp.alg]](cmp.alg "17.12.6 Comparison algorithms"), comparison algorithmsinline namespace *unspecified* {inline constexpr *unspecified* strong_order = *unspecified*; inline constexpr *unspecified* weak_order = *unspecified*; inline constexpr *unspecified* partial_order = *unspecified*; inline constexpr *unspecified* compare_strong_order_fallback = *unspecified*; inline constexpr *unspecified* compare_weak_order_fallback = *unspecified*; inline constexpr *unspecified* compare_partial_order_fallback = *unspecified*; }// [[compare.type]](compare.type "17.12.7 Type Ordering"), type orderingtemplatestruct type_order; templateconstexpr strong_ordering type_order_v = type_order::value;}