Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/range/v3/compare.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /// \file
0002 //  CPP, the Concepts PreProcessor library
0003 //
0004 //  Copyright Eric Niebler 2018-present
0005 //  Copyright (c) 2020-present, Google LLC.
0006 //
0007 //  Use, modification and distribution is subject to the
0008 //  Boost Software License, Version 1.0. (See accompanying
0009 //  file LICENSE_1_0.txt or copy at
0010 //  http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // This source code is licensed under the MIT license found in the
0013 // LICENSE file in the root directory of this source tree.
0014 //
0015 // Project home: https://github.com/ericniebler/range-v3
0016 //
0017 #ifndef RANGES_V3_COMPARE_HPP
0018 #define RANGES_V3_COMPARE_HPP
0019 
0020 #if __cplusplus > 201703L && __has_include(<compare>) && \
0021     defined(__cpp_concepts) && defined(__cpp_impl_three_way_comparison)
0022 
0023 #include <compare>
0024 #include <type_traits>
0025 
0026 namespace ranges
0027 {
0028    template<typename... Ts>
0029    struct common_comparison_category
0030    {
0031        using type = void;
0032    };
0033 
0034     template<typename... Ts>
0035     requires ((std::is_same_v<Ts, std::partial_ordering> ||
0036                std::is_same_v<Ts, std::weak_ordering> ||
0037                std::is_same_v<Ts, std::strong_ordering>) && ...)
0038     struct common_comparison_category<Ts...> : std::common_type<Ts...>
0039     {};
0040 
0041     template<typename... Ts>
0042     using common_comparison_category_t = typename common_comparison_category<Ts...>::type;
0043 } // namespace ranges
0044 
0045 #endif // __cplusplus
0046 #endif // RANGES_V3_COMPARE_HPP