From patchwork Fri Nov 25 15:08:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 61109 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4670938381EC for ; Fri, 25 Nov 2022 15:08:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4670938381EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669388936; bh=CNQApQ9YliF6ozQyDEbQs/gdwwvgm+34TL5SPk2inyA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dltb1/81lL4b497u6PLE2xnseUqc0uEMHVyXW11PcO+wahm8gWym8pNkrQ1t92c+G uDMt8Rjri9ZA4K5atUeWWMeoqUiPrS2IxFkg8nz/ajp7aNcfr27OgyT7ad0x8HqhSO l0lYK0tG9v/Z7jcK8wb3B2Lp71LArOeFcQCR1/y0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9FCC2384E3A5 for ; Fri, 25 Nov 2022 15:08:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9FCC2384E3A5 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-140-uZkTIN8sOXqdpXuVp-_YFA-1; Fri, 25 Nov 2022 10:08:19 -0500 X-MC-Unique: uZkTIN8sOXqdpXuVp-_YFA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AE331C068D7; Fri, 25 Nov 2022 15:08:19 +0000 (UTC) Received: from localhost (unknown [10.33.36.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FAA6492B08; Fri, 25 Nov 2022 15:08:18 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Do not define operator!= in for C++20 Date: Fri, 25 Nov 2022 15:08:16 +0000 Message-Id: <20221125150816.128776-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FILL_THIS_FORM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Tested x86_64-linux. Pushed to trunk. -- >8 -- These overloads are not needed in C++20 as they can be synthesized by the compiler. Removing them means less code to compile when including these headers. libstdc++-v3/ChangeLog: * include/bits/random.h [three_way_comparison] (operator!=): Do not define inequality operators when C++20 three way comparisons are supported. * include/ext/random [three_way_comparison] (operator!=): Likewise. --- libstdc++-v3/include/bits/random.h | 106 ++++++++++++++++++++++++----- libstdc++-v3/include/ext/random | 72 ++++++++++++++++---- 2 files changed, 148 insertions(+), 30 deletions(-) diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index 28b37a9e5a5..3b4e7d42bb5 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -423,6 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _UIntType _M_x; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Compares two linear congruential random number generator * objects of the same type for inequality. @@ -441,7 +442,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::linear_congruential_engine<_UIntType, __a, __c, __m>& __rhs) { return !(__lhs == __rhs); } - +#endif /** * A generalized feedback shift register discrete random number generator. @@ -656,6 +657,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_t _M_p; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Compares two % mersenne_twister_engine random number generator * objects of the same type for inequality. @@ -679,7 +681,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs) { return !(__lhs == __rhs); } - +#endif /** * @brief The Marsaglia-Zaman generator. @@ -862,6 +864,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_t _M_p; ///< Current index of x(i - r). }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Compares two % subtract_with_carry_engine random number * generator objects of the same type for inequality. @@ -881,7 +884,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::subtract_with_carry_engine<_UIntType, __w, __s, __r>& __rhs) { return !(__lhs == __rhs); } - +#endif /** * Produces random numbers from some base engine by discarding blocks of @@ -1087,6 +1090,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_t _M_n; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Compares two %discard_block_engine random number generator * objects of the same type for inequality. @@ -1105,7 +1109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::discard_block_engine<_RandomNumberEngine, __p, __r>& __rhs) { return !(__lhs == __rhs); } - +#endif /** * Produces random numbers by combining random numbers from some base @@ -1284,6 +1288,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _RandomNumberEngine _M_b; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Compares two %independent_bits_engine random number generator * objects of the same type for inequality. @@ -1303,6 +1308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::independent_bits_engine<_RandomNumberEngine, __w, _UIntType>& __rhs) { return !(__lhs == __rhs); } +#endif /** * @brief Inserts the current state of a %independent_bits_engine random @@ -1541,6 +1547,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION result_type _M_y; }; +#if __cpp_impl_three_way_comparison < 201907L /** * Compares two %shuffle_order_engine random number generator objects * of the same type for inequality. @@ -1559,7 +1566,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const std::shuffle_order_engine<_RandomNumberEngine, __k>& __rhs) { return !(__lhs == __rhs); } - +#endif /** * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller. @@ -1703,6 +1710,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // std::uniform_int_distribution is defined in +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two uniform integer distributions have * different parameters. @@ -1712,6 +1720,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::uniform_int_distribution<_IntType>& __d1, const std::uniform_int_distribution<_IntType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %uniform_int_distribution random number @@ -1786,9 +1795,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_a; @@ -1924,6 +1935,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two uniform real distributions have * different parameters. @@ -1933,6 +1945,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::uniform_real_distribution<_IntType>& __d1, const std::uniform_real_distribution<_IntType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %uniform_real_distribution random number @@ -2017,9 +2030,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return (__p1._M_mean == __p2._M_mean && __p1._M_stddev == __p2._M_stddev); } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_mean; @@ -2182,6 +2197,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_saved_available = false; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two normal distributions are different. */ @@ -2190,7 +2206,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::normal_distribution<_RealType>& __d1, const std::normal_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A lognormal_distribution random number distribution. @@ -2235,9 +2251,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_m; @@ -2393,6 +2411,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two lognormal distributions are different. */ @@ -2401,7 +2420,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::lognormal_distribution<_RealType>& __d1, const std::lognormal_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A gamma continuous distribution for random numbers. @@ -2451,9 +2470,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return (__p1._M_alpha == __p2._M_alpha && __p1._M_beta == __p2._M_beta); } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -2624,6 +2645,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two gamma distributions are different. */ @@ -2632,7 +2654,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::gamma_distribution<_RealType>& __d1, const std::gamma_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A chi_squared_distribution random number distribution. @@ -2670,9 +2692,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_n == __p2._M_n; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_n; @@ -2848,6 +2872,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Chi-squared distributions are different. */ @@ -2856,7 +2881,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::chi_squared_distribution<_RealType>& __d1, const std::chi_squared_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A cauchy_distribution random number distribution. @@ -2898,9 +2923,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_a; @@ -3021,6 +3048,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Cauchy distributions have * different parameters. @@ -3030,6 +3058,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::cauchy_distribution<_RealType>& __d1, const std::cauchy_distribution<_RealType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %cauchy_distribution random number distribution @@ -3106,9 +3135,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_m; @@ -3286,6 +3317,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd_x, _M_gd_y; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Fisher f distributions are different. */ @@ -3294,6 +3326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::fisher_f_distribution<_RealType>& __d1, const std::fisher_f_distribution<_RealType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief A student_t_distribution random number distribution. @@ -3334,9 +3367,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_n == __p2._M_n; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_n; @@ -3508,6 +3543,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Student t distributions are different. */ @@ -3516,7 +3552,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::student_t_distribution<_RealType>& __d1, const std::student_t_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /// @} group random_distributions_normal @@ -3560,9 +3596,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_p == __p2._M_p; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: double _M_p; @@ -3696,6 +3734,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Bernoulli distributions have * different parameters. @@ -3704,6 +3743,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::bernoulli_distribution& __d1, const std::bernoulli_distribution& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %bernoulli_distribution random number distribution @@ -3788,9 +3828,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -3971,6 +4013,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two binomial distributions are different. */ @@ -3979,7 +4022,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::binomial_distribution<_IntType>& __d1, const std::binomial_distribution<_IntType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A discrete geometric random number distribution. @@ -4022,9 +4065,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_p == __p2._M_p; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -4149,6 +4194,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two geometric distributions have * different parameters. @@ -4158,6 +4204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::geometric_distribution<_IntType>& __d1, const std::geometric_distribution<_IntType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %geometric_distribution random number distribution @@ -4234,9 +4281,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _IntType _M_k; @@ -4404,6 +4453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two negative binomial distributions are different. */ @@ -4412,7 +4462,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::negative_binomial_distribution<_IntType>& __d1, const std::negative_binomial_distribution<_IntType>& __d2) { return !(__d1 == __d2); } - +#endif /// @} group random_distributions_bernoulli @@ -4463,9 +4513,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_mean == __p2._M_mean; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: // Hosts either log(mean) or the threshold of the simple method. @@ -4630,6 +4682,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Poisson distributions are different. */ @@ -4638,7 +4691,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::poisson_distribution<_IntType>& __d1, const std::poisson_distribution<_IntType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief An exponential continuous distribution for random numbers. @@ -4687,9 +4740,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_lambda == __p2._M_lambda; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_lambda; @@ -4820,6 +4875,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two exponential distributions have different * parameters. @@ -4829,6 +4885,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::exponential_distribution<_RealType>& __d1, const std::exponential_distribution<_RealType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %exponential_distribution random number distribution @@ -4904,9 +4961,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_a; @@ -5030,6 +5089,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Weibull distributions have different * parameters. @@ -5039,6 +5099,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::weibull_distribution<_RealType>& __d1, const std::weibull_distribution<_RealType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %weibull_distribution random number distribution @@ -5114,9 +5175,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_a; @@ -5240,6 +5303,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two extreme value distributions have different * parameters. @@ -5249,6 +5313,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::extreme_value_distribution<_RealType>& __d1, const std::extreme_value_distribution<_RealType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief Inserts a %extreme_value_distribution random number distribution @@ -5333,9 +5398,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_prob == __p2._M_prob; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -5505,6 +5572,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two discrete distributions have different * parameters. @@ -5514,7 +5582,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::discrete_distribution<_IntType>& __d1, const std::discrete_distribution<_IntType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A piecewise_constant_distribution random number distribution. @@ -5579,9 +5647,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -5776,6 +5846,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two piecewise constant distributions have * different parameters. @@ -5785,7 +5856,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::piecewise_constant_distribution<_RealType>& __d1, const std::piecewise_constant_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A piecewise_linear_distribution random number distribution. @@ -5850,9 +5921,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -6049,6 +6122,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two piecewise linear distributions have * different parameters. @@ -6058,7 +6132,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const std::piecewise_linear_distribution<_RealType>& __d1, const std::piecewise_linear_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /// @} group random_distributions_poisson diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 406b12b5d23..eb7eaf5bc69 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -208,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void _M_period_certification(); }; - +#if __cpp_impl_three_way_comparison < 201907L template& __rhs) { return !(__lhs == __rhs); } - +#endif /* Definitions for the SIMD-oriented Fast Mersenne Twister as defined * in the C implementation by Daito and Matsumoto, as both a 32-bit @@ -451,9 +451,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return (__p1._M_alpha == __p2._M_alpha && __p1._M_beta == __p2._M_beta); } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void @@ -616,6 +618,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two beta distributions are different. */ @@ -624,7 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const __gnu_cxx::beta_distribution<_RealType>& __d1, const __gnu_cxx::beta_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A multi-variate normal continuous distribution for random numbers. @@ -735,9 +738,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_mean == __p2._M_mean && __p1._M_t == __p2._M_t; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: template @@ -943,6 +948,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution<_RealType> _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two multi-variate normal distributions are * different. @@ -954,7 +960,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const __gnu_cxx::normal_mv_distribution<_Dimen, _RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A Rice continuous distribution for random numbers. @@ -1014,9 +1020,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_nu == __p2._M_nu && __p1._M_sigma == __p2._M_sigma; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -1209,6 +1217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution _M_ndy; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Rice distributions are not equal. */ @@ -1217,7 +1226,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const rice_distribution<_RealType1>& __d1, const rice_distribution<_RealType1>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A Nakagami continuous distribution for random numbers. @@ -1268,9 +1277,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_mu == __p2._M_mu && __p1._M_omega == __p2._M_omega; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -1442,6 +1453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Nakagami distributions are not equal. */ @@ -1450,7 +1462,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const nakagami_distribution<_RealType>& __d1, const nakagami_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A Pareto continuous distribution for random numbers. @@ -1513,9 +1525,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_alpha == __p2._M_alpha && __p1._M_mu == __p2._M_mu; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -1691,6 +1705,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::uniform_real_distribution _M_ud; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Pareto distributions are not equal. */ @@ -1699,7 +1714,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const pareto_distribution<_RealType>& __d1, const pareto_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A K continuous distribution for random numbers. @@ -1770,9 +1785,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION && __p1._M_nu == __p2._M_nu; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -1950,6 +1967,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::gamma_distribution _M_gd2; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two K distributions are not equal. */ @@ -1958,7 +1976,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const k_distribution<_RealType>& __d1, const k_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief An arcsine continuous distribution for random numbers. @@ -2012,9 +2030,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -2191,6 +2211,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::uniform_real_distribution _M_ud; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two arcsine distributions are not equal. */ @@ -2199,7 +2220,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const arcsine_distribution<_RealType>& __d1, const arcsine_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A Hoyt continuous distribution for random numbers. @@ -2260,9 +2281,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_q == __p2._M_q && __p1._M_omega == __p2._M_omega; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -2436,6 +2459,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::exponential_distribution _M_ed; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two Hoyt distributions are not equal. */ @@ -2444,7 +2468,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const hoyt_distribution<_RealType>& __d1, const hoyt_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A triangular distribution for random numbers. @@ -2516,9 +2540,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION && __p1._M_c == __p2._M_c); } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: @@ -2700,6 +2726,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two triangle distributions are different. */ @@ -2708,7 +2735,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const __gnu_cxx::triangular_distribution<_RealType>& __d1, const __gnu_cxx::triangular_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A von Mises distribution for random numbers. @@ -2776,9 +2803,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_mu == __p2._M_mu && __p1._M_kappa == __p2._M_kappa; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_mu; @@ -2942,6 +2971,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two von Mises distributions are different. */ @@ -2950,7 +2980,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const __gnu_cxx::von_mises_distribution<_RealType>& __d1, const __gnu_cxx::von_mises_distribution<_RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A discrete hypergeometric random number distribution. @@ -3024,9 +3054,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION && (__p1._M_K == __p2._M_K) && (__p1._M_n == __p2._M_n); } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: @@ -3212,6 +3244,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two hypergeometric distributions are different. */ @@ -3220,6 +3253,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const __gnu_cxx::hypergeometric_distribution<_UIntType>& __d1, const __gnu_cxx::hypergeometric_distribution<_UIntType>& __d2) { return !(__d1 == __d2); } +#endif /** * @brief A logistic continuous distribution for random numbers. @@ -3280,9 +3314,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: void _M_initialize(); @@ -3443,6 +3479,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION param_type _M_param; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two logistic distributions are not equal. */ @@ -3451,7 +3488,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const logistic_distribution<_RealType1>& __d1, const logistic_distribution<_RealType1>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A distribution for random coordinates on a unit sphere. @@ -3479,9 +3516,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type&, const param_type&) { return true; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type&, const param_type&) { return false; } +#endif }; /** @@ -3636,6 +3675,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::normal_distribution<_RealType> _M_nd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two uniform on sphere distributions are different. */ @@ -3646,7 +3686,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const __gnu_cxx::uniform_on_sphere_distribution<_Dimen, _RealType>& __d2) { return !(__d1 == __d2); } - +#endif /** * @brief A distribution for random coordinates inside a unit sphere. @@ -3686,9 +3726,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator==(const param_type& __p1, const param_type& __p2) { return __p1._M_radius == __p2._M_radius; } +#if __cpp_impl_three_way_comparison < 201907L friend bool operator!=(const param_type& __p1, const param_type& __p2) { return !(__p1 == __p2); } +#endif private: _RealType _M_radius; @@ -3862,6 +3904,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION uniform_on_sphere_distribution<_Dimen, _RealType> _M_uosd; }; +#if __cpp_impl_three_way_comparison < 201907L /** * @brief Return true if two uniform on sphere distributions are different. */ @@ -3872,6 +3915,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const __gnu_cxx::uniform_inside_sphere_distribution<_Dimen, _RealType>& __d2) { return !(__d1 == __d2); } +#endif _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx