Use constexpr instead of ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 These are equivalent since they fall back to the standard library. There's no need to reimpose whatever constraints the standard library already imposes. PiperOrigin-RevId: 926341943 Change-Id: I406d1203ca2d4fec68ae7a06eef0cf2dad6916dd
diff --git a/absl/algorithm/algorithm.h b/absl/algorithm/algorithm.h index 4e2ebf4..0b75908 100644 --- a/absl/algorithm/algorithm.h +++ b/absl/algorithm/algorithm.h
@@ -85,8 +85,8 @@ // n = (`last` - `first`) comparisons. A linear search over short containers // may be faster than a binary search, even when the container is sorted. template <typename InputIterator, typename EqualityComparable> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search( - InputIterator first, InputIterator last, const EqualityComparable& value) { +constexpr bool linear_search(InputIterator first, InputIterator last, + const EqualityComparable& value) { return std::find(first, last, value) != last; }
diff --git a/absl/algorithm/container.h b/absl/algorithm/container.h index 838f0db..3361e71 100644 --- a/absl/algorithm/container.h +++ b/absl/algorithm/container.h
@@ -208,8 +208,7 @@ // // For a generalization that uses a predicate, see absl::c_any_of(). template <typename C, typename EqualityComparable> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_linear_search( - const C& c, EqualityComparable&& value) { +constexpr bool c_linear_search(const C& c, EqualityComparable&& value) { return absl::linear_search(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<EqualityComparable>(value)); @@ -239,7 +238,7 @@ // Container-based version of the <algorithm> `std::all_of()` function to // test if all elements within a container satisfy a condition. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_all_of(const C& c, Pred&& pred) { +constexpr bool c_all_of(const C& c, Pred&& pred) { return std::all_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -250,7 +249,7 @@ // Container-based version of the <algorithm> `std::any_of()` function to // test if any element in a container fulfills a condition. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_any_of(const C& c, Pred&& pred) { +constexpr bool c_any_of(const C& c, Pred&& pred) { return std::any_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -261,7 +260,7 @@ // Container-based version of the <algorithm> `std::none_of()` function to // test if no elements in a container fulfill a condition. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_none_of(const C& c, Pred&& pred) { +constexpr bool c_none_of(const C& c, Pred&& pred) { return std::none_of(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -272,8 +271,7 @@ // Container-based version of the <algorithm> `std::for_each()` function to // apply a function to a container's elements. template <typename C, typename Function> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::decay_t<Function> c_for_each( - C&& c, Function&& f) { +constexpr std::decay_t<Function> c_for_each(C&& c, Function&& f) { return std::for_each(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Function>(f)); @@ -284,9 +282,8 @@ // Container-based version of the <algorithm> `std::find()` function to find // the first element containing the passed value within a container value. template <typename C, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_find(C& c, T&& value) { +constexpr container_algorithm_internal::ContainerIter<C> c_find(C& c, + T&& value) { return std::find(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<T>(value)); @@ -297,8 +294,7 @@ // Container-based version of the <algorithm> `std::ranges::contains()` C++23 // function to search a container for a value. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains(const Sequence& sequence, - T&& value) { +constexpr bool c_contains(const Sequence& sequence, T&& value) { return absl::c_find(sequence, std::forward<T>(value)) != container_algorithm_internal::c_end(sequence); } @@ -308,9 +304,8 @@ // Container-based version of the <algorithm> `std::find_if()` function to find // the first element in a container matching the given condition. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_find_if(C& c, Pred&& pred) { +constexpr container_algorithm_internal::ContainerIter<C> c_find_if( + C& c, Pred&& pred) { return std::find_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -321,9 +316,8 @@ // Container-based version of the <algorithm> `std::find_if_not()` function to // find the first element in a container not matching the given condition. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_find_if_not(C& c, Pred&& pred) { +constexpr container_algorithm_internal::ContainerIter<C> c_find_if_not( + C& c, Pred&& pred) { return std::find_if_not(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -334,9 +328,8 @@ // Container-based version of the <algorithm> `std::find_end()` function to // find the last subsequence within a container. template <typename Sequence1, typename Sequence2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence1> - c_find_end(Sequence1& sequence, Sequence2& subsequence) { +constexpr container_algorithm_internal::ContainerIter<Sequence1> c_find_end( + Sequence1& sequence, Sequence2& subsequence) { return std::find_end(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), @@ -346,10 +339,8 @@ // Overload of c_find_end() for using a predicate evaluation other than `==` as // the function's test condition. template <typename Sequence1, typename Sequence2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence1> - c_find_end(Sequence1& sequence, Sequence2& subsequence, - BinaryPredicate&& pred) { +constexpr container_algorithm_internal::ContainerIter<Sequence1> c_find_end( + Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { return std::find_end(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), @@ -363,9 +354,8 @@ // find the first element within the container that is also within the options // container. template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C1> - c_find_first_of(C1& container, const C2& options) { +constexpr container_algorithm_internal::ContainerIter<C1> c_find_first_of( + C1& container, const C2& options) { return std::find_first_of(container_algorithm_internal::c_begin(container), container_algorithm_internal::c_end(container), container_algorithm_internal::c_begin(options), @@ -375,9 +365,8 @@ // Overload of c_find_first_of() for using a predicate evaluation other than // `==` as the function's test condition. template <typename C1, typename C2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C1> - c_find_first_of(C1& container, const C2& options, BinaryPredicate&& pred) { +constexpr container_algorithm_internal::ContainerIter<C1> c_find_first_of( + C1& container, const C2& options, BinaryPredicate&& pred) { return std::find_first_of(container_algorithm_internal::c_begin(container), container_algorithm_internal::c_end(container), container_algorithm_internal::c_begin(options), @@ -390,9 +379,8 @@ // Container-based version of the <algorithm> `std::adjacent_find()` function to // find equal adjacent elements within a container. template <typename Sequence> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_adjacent_find(Sequence& sequence) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_adjacent_find( + Sequence& sequence) { return std::adjacent_find(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -400,9 +388,8 @@ // Overload of c_adjacent_find() for using a predicate evaluation other than // `==` as the function's test condition. template <typename Sequence, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_adjacent_find(Sequence& sequence, BinaryPredicate&& pred) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_adjacent_find( + Sequence& sequence, BinaryPredicate&& pred) { return std::adjacent_find(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<BinaryPredicate>(pred)); @@ -413,9 +400,8 @@ // Container-based version of the <algorithm> `std::count()` function to count // values that match within a container. template <typename C, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerDifferenceType<const C> - c_count(const C& c, T&& value) { +constexpr container_algorithm_internal::ContainerDifferenceType<const C> +c_count(const C& c, T&& value) { return std::count(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<T>(value)); @@ -426,9 +412,8 @@ // Container-based version of the <algorithm> `std::count_if()` function to // count values matching a condition within a container. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerDifferenceType<const C> - c_count_if(const C& c, Pred&& pred) { +constexpr container_algorithm_internal::ContainerDifferenceType<const C> +c_count_if(const C& c, Pred&& pred) { return std::count_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -440,9 +425,8 @@ // return the first element where two ordered containers differ. Applies `==` to // the first N elements of `c1` and `c2`, where N = min(size(c1), size(c2)). template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIterPairType<C1, C2> - c_mismatch(C1& c1, C2& c2) { +constexpr container_algorithm_internal::ContainerIterPairType<C1, C2> +c_mismatch(C1& c1, C2& c2) { return std::mismatch(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -453,9 +437,8 @@ // the function's test condition. Applies `pred`to the first N elements of `c1` // and `c2`, where N = min(size(c1), size(c2)). template <typename C1, typename C2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIterPairType<C1, C2> - c_mismatch(C1& c1, C2& c2, BinaryPredicate pred) { +constexpr container_algorithm_internal::ContainerIterPairType<C1, C2> +c_mismatch(C1& c1, C2& c2, BinaryPredicate pred) { return std::mismatch(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -467,7 +450,7 @@ // Container-based version of the <algorithm> `std::equal()` function to // test whether two containers are equal. template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_equal(const C1& c1, const C2& c2) { +constexpr bool c_equal(const C1& c1, const C2& c2) { return std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -477,8 +460,7 @@ // Overload of c_equal() for using a predicate evaluation other than `==` as // the function's test condition. template <typename C1, typename C2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_equal(const C1& c1, const C2& c2, - BinaryPredicate&& pred) { +constexpr bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) { return std::equal(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -491,8 +473,7 @@ // Container-based version of the <algorithm> `std::is_permutation()` function // to test whether a container is a permutation of another. template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_permutation(const C1& c1, - const C2& c2) { +constexpr bool c_is_permutation(const C1& c1, const C2& c2) { return std::is_permutation(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -502,8 +483,8 @@ // Overload of c_is_permutation() for using a predicate evaluation other than // `==` as the function's test condition. template <typename C1, typename C2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_permutation( - const C1& c1, const C2& c2, BinaryPredicate&& pred) { +constexpr bool c_is_permutation(const C1& c1, const C2& c2, + BinaryPredicate&& pred) { return std::is_permutation(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -516,9 +497,8 @@ // Container-based version of the <algorithm> `std::search()` function to search // a container for a subsequence. template <typename Sequence1, typename Sequence2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence1> - c_search(Sequence1& sequence, Sequence2& subsequence) { +constexpr container_algorithm_internal::ContainerIter<Sequence1> c_search( + Sequence1& sequence, Sequence2& subsequence) { return std::search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), @@ -528,10 +508,8 @@ // Overload of c_search() for using a predicate evaluation other than // `==` as the function's test condition. template <typename Sequence1, typename Sequence2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence1> - c_search(Sequence1& sequence, Sequence2& subsequence, - BinaryPredicate&& pred) { +constexpr container_algorithm_internal::ContainerIter<Sequence1> c_search( + Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { return std::search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(subsequence), @@ -544,8 +522,8 @@ // Container-based version of the <algorithm> `std::ranges::contains_subrange()` // C++23 function to search a container for a subsequence. template <typename Sequence1, typename Sequence2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains_subrange( - Sequence1& sequence, Sequence2& subsequence) { +constexpr bool c_contains_subrange(Sequence1& sequence, + Sequence2& subsequence) { return absl::c_search(sequence, subsequence) != container_algorithm_internal::c_end(sequence); } @@ -553,8 +531,8 @@ // Overload of c_contains_subrange() for using a predicate evaluation other than // `==` as the function's test condition. template <typename Sequence1, typename Sequence2, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_contains_subrange( - Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) { +constexpr bool c_contains_subrange(Sequence1& sequence, Sequence2& subsequence, + BinaryPredicate&& pred) { return absl::c_search(sequence, subsequence, std::forward<BinaryPredicate>(pred)) != container_algorithm_internal::c_end(sequence); @@ -565,9 +543,8 @@ // Container-based version of the <algorithm> `std::search_n()` function to // search a container for the first sequence of N elements. template <typename Sequence, typename Size, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_search_n(Sequence& sequence, Size count, T&& value) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_search_n( + Sequence& sequence, Size count, T&& value) { return std::search_n(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), count, std::forward<T>(value)); @@ -577,10 +554,8 @@ // `==` as the function's test condition. template <typename Sequence, typename Size, typename T, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_search_n(Sequence& sequence, Size count, T&& value, - BinaryPredicate&& pred) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_search_n( + Sequence& sequence, Size count, T&& value, BinaryPredicate&& pred) { return std::search_n(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), count, std::forward<T>(value), @@ -596,9 +571,9 @@ // Container-based version of the <algorithm> `std::copy()` function to copy a // container's elements into an iterator. template <typename InputSequence, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 container_algorithm_internal:: - ResultOfRangeToIteratorTransfer<InputSequence, OutputIterator> - c_copy(const InputSequence& input, OutputIterator&& output) { +constexpr container_algorithm_internal::ResultOfRangeToIteratorTransfer< + InputSequence, OutputIterator> +c_copy(const InputSequence& input, OutputIterator&& output) { return std::copy(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), std::forward<OutputIterator>(output)); @@ -615,10 +590,9 @@ // If `std::size(output) > std::size(input)`, only `std::size(input)` elements // are copied, and `output` is not truncated. template <typename InputSequence, typename OutputRange> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ResultOfRangeToRangeTransfer<InputSequence, - OutputRange> - c_copy(const InputSequence& input, OutputRange&& output) { +constexpr container_algorithm_internal::ResultOfRangeToRangeTransfer< + InputSequence, OutputRange> +c_copy(const InputSequence& input, OutputRange&& output) { container_algorithm_internal::AssertCopySize(input, output); absl::c_copy(input, container_algorithm_internal::c_begin( std::forward<OutputRange>(output))); @@ -629,9 +603,9 @@ // Container-based version of the <algorithm> `std::copy_n()` function to copy a // container's first N elements into an iterator. template <typename C, typename Size, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 container_algorithm_internal:: - ResultOfRangeToIteratorTransfer<C, OutputIterator> - c_copy_n(const C& input, Size n, OutputIterator&& output) { +constexpr container_algorithm_internal::ResultOfRangeToIteratorTransfer< + C, OutputIterator> +c_copy_n(const C& input, Size n, OutputIterator&& output) { return std::copy_n(container_algorithm_internal::c_begin(input), n, std::forward<OutputIterator>(output)); } @@ -648,9 +622,9 @@ // If `std::size(output) > n`, only `n` elements are copied, and `output` is not // truncated. template <typename C, typename Size, typename OutputRange> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ResultOfRangeToRangeTransfer<C, OutputRange> - c_copy_n(const C& input, Size n, OutputRange&& output) { +constexpr container_algorithm_internal::ResultOfRangeToRangeTransfer< + C, OutputRange> +c_copy_n(const C& input, Size n, OutputRange&& output) { container_algorithm_internal::AssertCopyNSize(input, n, output); absl::c_copy_n( input, n, @@ -662,8 +636,8 @@ // Container-based version of the <algorithm> `std::copy_if()` function to copy // a container's elements satisfying some condition into an iterator. template <typename InputSequence, typename OutputIterator, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_copy_if(const InputSequence& input, OutputIterator output, Pred&& pred) { +constexpr OutputIterator c_copy_if(const InputSequence& input, + OutputIterator output, Pred&& pred) { return std::copy_if(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output, std::forward<Pred>(pred)); @@ -674,8 +648,8 @@ // Container-based version of the <algorithm> `std::copy_backward()` function to // copy a container's elements in reverse order into an iterator. template <typename C, typename BidirectionalIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 BidirectionalIterator -c_copy_backward(const C& src, BidirectionalIterator dest) { +constexpr BidirectionalIterator c_copy_backward(const C& src, + BidirectionalIterator dest) { return std::copy_backward(container_algorithm_internal::c_begin(src), container_algorithm_internal::c_end(src), dest); } @@ -685,9 +659,9 @@ // Container-based version of the <algorithm> `std::move()` function to move // a container's elements into an iterator. template <typename C, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 container_algorithm_internal:: - ResultOfRangeToIteratorTransfer<C, OutputIterator> - c_move(C&& src, OutputIterator&& dest) { +constexpr container_algorithm_internal::ResultOfRangeToIteratorTransfer< + C, OutputIterator> +c_move(C&& src, OutputIterator&& dest) { return std::move(container_algorithm_internal::c_begin(src), container_algorithm_internal::c_end(src), std::forward<OutputIterator>(dest)); @@ -699,9 +673,9 @@ // The `dest` container must be large enough to hold all elements of `src`; // this function does not resize `dest`. template <typename C, typename OutputRange> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ResultOfRangeToRangeTransfer<C, OutputRange> - c_move(C&& src, OutputRange&& dest) { +constexpr container_algorithm_internal::ResultOfRangeToRangeTransfer< + C, OutputRange> +c_move(C&& src, OutputRange&& dest) { container_algorithm_internal::AssertCopySize(src, dest); absl::c_move(std::forward<C>(src), container_algorithm_internal::c_begin( std::forward<OutputRange>(dest))); @@ -712,8 +686,8 @@ // Container-based version of the <algorithm> `std::move_backward()` function to // move a container's elements into an iterator in reverse order. template <typename C, typename BidirectionalIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 BidirectionalIterator -c_move_backward(C&& src, BidirectionalIterator dest) { +constexpr BidirectionalIterator c_move_backward(C&& src, + BidirectionalIterator dest) { return std::move_backward(container_algorithm_internal::c_begin(src), container_algorithm_internal::c_end(src), dest); } @@ -724,9 +698,8 @@ // swap a container's elements with another container's elements. Swaps the // first N elements of `c1` and `c2`, where N = min(size(c1), size(c2)). template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C2> - c_swap_ranges(C1& c1, C2& c2) { +constexpr container_algorithm_internal::ContainerIter<C2> c_swap_ranges( + C1& c1, C2& c2) { auto first1 = container_algorithm_internal::c_begin(c1); auto last1 = container_algorithm_internal::c_end(c1); auto first2 = container_algorithm_internal::c_begin(c2); @@ -746,8 +719,9 @@ // result in an iterator pointing to the last transformed element in the output // range. template <typename InputSequence, typename OutputIterator, typename UnaryOp> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_transform( - const InputSequence& input, OutputIterator output, UnaryOp&& unary_op) { +constexpr OutputIterator c_transform(const InputSequence& input, + OutputIterator output, + UnaryOp&& unary_op) { return std::transform(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output, std::forward<UnaryOp>(unary_op)); @@ -758,9 +732,10 @@ // where N = min(size(c1), size(c2)). template <typename InputSequence1, typename InputSequence2, typename OutputIterator, typename BinaryOp> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_transform(const InputSequence1& input1, const InputSequence2& input2, - OutputIterator output, BinaryOp&& binary_op) { +constexpr OutputIterator c_transform(const InputSequence1& input1, + const InputSequence2& input2, + OutputIterator output, + BinaryOp&& binary_op) { auto first1 = container_algorithm_internal::c_begin(input1); auto last1 = container_algorithm_internal::c_end(input1); auto first2 = container_algorithm_internal::c_begin(input2); @@ -779,9 +754,8 @@ // replace a container's elements of some value with a new value. The container // is modified in place. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_replace(Sequence& sequence, - const T& old_value, - const T& new_value) { +constexpr void c_replace(Sequence& sequence, const T& old_value, + const T& new_value) { std::replace(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), old_value, new_value); @@ -793,8 +767,7 @@ // replace a container's elements of some value with a new value based on some // condition. The container is modified in place. template <typename C, typename Pred, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_replace_if(C& c, Pred&& pred, - T&& new_value) { +constexpr void c_replace_if(C& c, Pred&& pred, T&& new_value) { std::replace_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred), std::forward<T>(new_value)); @@ -806,8 +779,8 @@ // replace a container's elements of some value with a new value and return the // results within an iterator. template <typename C, typename OutputIterator, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_replace_copy( - const C& c, OutputIterator result, T&& old_value, T&& new_value) { +constexpr OutputIterator c_replace_copy(const C& c, OutputIterator result, + T&& old_value, T&& new_value) { return std::replace_copy(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, std::forward<T>(old_value), @@ -820,8 +793,8 @@ // to replace a container's elements of some value with a new value based on // some condition, and return the results within an iterator. template <typename C, typename OutputIterator, typename Pred, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_replace_copy_if( - const C& c, OutputIterator result, Pred&& pred, const T& new_value) { +constexpr OutputIterator c_replace_copy_if(const C& c, OutputIterator result, + Pred&& pred, const T& new_value) { return std::replace_copy_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, std::forward<Pred>(pred), new_value); @@ -832,7 +805,7 @@ // Container-based version of the <algorithm> `std::fill()` function to fill a // container with some value. template <typename C, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_fill(C& c, const T& value) { +constexpr void c_fill(C& c, const T& value) { std::fill(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), value); } @@ -842,8 +815,7 @@ // Container-based version of the <algorithm> `std::fill_n()` function to fill // the first N elements in a container with some value. template <typename C, typename Size, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_fill_n(C& c, Size n, - const T& value) { +constexpr void c_fill_n(C& c, Size n, const T& value) { std::fill_n(container_algorithm_internal::c_begin(c), n, value); } @@ -852,7 +824,7 @@ // Container-based version of the <algorithm> `std::generate()` function to // assign a container's elements to the values provided by the given generator. template <typename C, typename Generator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_generate(C& c, Generator&& gen) { +constexpr void c_generate(C& c, Generator&& gen) { std::generate(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Generator>(gen)); @@ -864,9 +836,8 @@ // assign a container's first N elements to the values provided by the given // generator. template <typename C, typename Size, typename Generator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_generate_n(C& c, Size n, Generator&& gen) { +constexpr container_algorithm_internal::ContainerIter<C> c_generate_n( + C& c, Size n, Generator&& gen) { return std::generate_n(container_algorithm_internal::c_begin(c), n, std::forward<Generator>(gen)); } @@ -882,8 +853,8 @@ // copy a container's elements while removing any elements matching the given // `value`. template <typename C, typename OutputIterator, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_remove_copy(const C& c, OutputIterator result, const T& value) { +constexpr OutputIterator c_remove_copy(const C& c, OutputIterator result, + const T& value) { return std::remove_copy(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, value); @@ -895,8 +866,8 @@ // to copy a container's elements while removing any elements matching the given // condition. template <typename C, typename OutputIterator, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_remove_copy_if(const C& c, OutputIterator result, Pred&& pred) { +constexpr OutputIterator c_remove_copy_if(const C& c, OutputIterator result, + Pred&& pred) { return std::remove_copy_if(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, std::forward<Pred>(pred)); @@ -908,8 +879,7 @@ // copy a container's elements while removing any elements containing duplicate // values. template <typename C, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_unique_copy(const C& c, OutputIterator result) { +constexpr OutputIterator c_unique_copy(const C& c, OutputIterator result) { return std::unique_copy(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result); } @@ -917,8 +887,8 @@ // Overload of c_unique_copy() for using a predicate evaluation other than // `==` for comparing uniqueness of the element values. template <typename C, typename OutputIterator, typename BinaryPredicate> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_unique_copy(const C& c, OutputIterator result, BinaryPredicate&& pred) { +constexpr OutputIterator c_unique_copy(const C& c, OutputIterator result, + BinaryPredicate&& pred) { return std::unique_copy(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), result, std::forward<BinaryPredicate>(pred)); @@ -929,7 +899,7 @@ // Container-based version of the <algorithm> `std::reverse()` function to // reverse a container's elements. template <typename Sequence> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_reverse(Sequence& sequence) { +constexpr void c_reverse(Sequence& sequence) { std::reverse(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -939,8 +909,8 @@ // Container-based version of the <algorithm> `std::reverse()` function to // reverse a container's elements and write them to an iterator range. template <typename C, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_reverse_copy(const C& sequence, OutputIterator result) { +constexpr OutputIterator c_reverse_copy(const C& sequence, + OutputIterator result) { return std::reverse_copy(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), result); @@ -953,8 +923,7 @@ // the first element in the container. template <typename C, typename Iterator = container_algorithm_internal::ContainerIter<C>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 Iterator c_rotate(C& sequence, - Iterator middle) { +constexpr Iterator c_rotate(C& sequence, Iterator middle) { return std::rotate(container_algorithm_internal::c_begin(sequence), middle, container_algorithm_internal::c_end(sequence)); } @@ -965,10 +934,10 @@ // shift a container's elements leftward such that the `middle` element becomes // the first element in a new iterator range. template <typename C, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_rotate_copy(const C& sequence, - container_algorithm_internal::ContainerIter<const C> middle, - OutputIterator result) { +constexpr OutputIterator c_rotate_copy( + const C& sequence, + container_algorithm_internal::ContainerIter<const C> middle, + OutputIterator result) { return std::rotate_copy(container_algorithm_internal::c_begin(sequence), middle, container_algorithm_internal::c_end(sequence), result); @@ -1010,8 +979,7 @@ // to test whether all elements in the container for which `pred` returns `true` // precede those for which `pred` is `false`. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_partitioned(const C& c, - Pred&& pred) { +constexpr bool c_is_partitioned(const C& c, Pred&& pred) { return std::is_partitioned(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -1024,9 +992,8 @@ // which `pred` returns `true` precede all those for which it returns `false`, // returning an iterator to the first element of the second group. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_partition(C& c, Pred&& pred) { +constexpr container_algorithm_internal::ContainerIter<C> c_partition( + C& c, Pred&& pred) { return std::partition(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -1055,9 +1022,9 @@ template <typename C, typename OutputIterator1, typename OutputIterator2, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::pair<OutputIterator1, OutputIterator2> -c_partition_copy(const C& c, OutputIterator1 out_true, - OutputIterator2 out_false, Pred&& pred) { +constexpr std::pair<OutputIterator1, OutputIterator2> c_partition_copy( + const C& c, OutputIterator1 out_true, OutputIterator2 out_false, + Pred&& pred) { return std::partition_copy(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), out_true, out_false, std::forward<Pred>(pred)); @@ -1069,9 +1036,8 @@ // to return the first element of an already partitioned container for which // the given `pred` is not `true`. template <typename C, typename Pred> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_partition_point(C& c, Pred&& pred) { +constexpr container_algorithm_internal::ContainerIter<C> c_partition_point( + C& c, Pred&& pred) { return std::partition_point(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<Pred>(pred)); @@ -1086,7 +1052,7 @@ // Container-based version of the <algorithm> `std::sort()` function // to sort elements in ascending order of their values. template <typename C> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_sort(C& c) { +constexpr void c_sort(C& c) { std::sort(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1094,7 +1060,7 @@ // Overload of c_sort() for performing a `comp` comparison other than the // default `operator<`. template <typename C, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_sort(C& c, LessThan&& comp) { +constexpr void c_sort(C& c, LessThan&& comp) { std::sort(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<LessThan>(comp)); @@ -1125,7 +1091,7 @@ // Container-based version of the <algorithm> `std::is_sorted()` function // to evaluate whether the given container is sorted in ascending order. template <typename C> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_sorted(const C& c) { +constexpr bool c_is_sorted(const C& c) { return std::is_sorted(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1133,8 +1099,7 @@ // c_is_sorted() overload for performing a `comp` comparison other than the // default `operator<`. template <typename C, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_sorted(const C& c, - LessThan&& comp) { +constexpr bool c_is_sorted(const C& c, LessThan&& comp) { return std::is_sorted(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<LessThan>(comp)); @@ -1146,7 +1111,7 @@ // to rearrange elements within a container such that elements before `middle` // are sorted in ascending order. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_partial_sort( +constexpr void c_partial_sort( RandomAccessContainer& sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> middle) { std::partial_sort(container_algorithm_internal::c_begin(sequence), middle, @@ -1156,7 +1121,7 @@ // Overload of c_partial_sort() for performing a `comp` comparison other than // the default `operator<`. template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_partial_sort( +constexpr void c_partial_sort( RandomAccessContainer& sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> middle, LessThan&& comp) { @@ -1173,9 +1138,8 @@ // At most min(result.last - result.first, sequence.last - sequence.first) // elements from the sequence will be stored in the result. template <typename C, typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<RandomAccessContainer> - c_partial_sort_copy(const C& sequence, RandomAccessContainer& result) { +constexpr container_algorithm_internal::ContainerIter<RandomAccessContainer> +c_partial_sort_copy(const C& sequence, RandomAccessContainer& result) { return std::partial_sort_copy(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(result), @@ -1185,10 +1149,9 @@ // Overload of c_partial_sort_copy() for performing a `comp` comparison other // than the default `operator<`. template <typename C, typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<RandomAccessContainer> - c_partial_sort_copy(const C& sequence, RandomAccessContainer& result, - LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIter<RandomAccessContainer> +c_partial_sort_copy(const C& sequence, RandomAccessContainer& result, + LessThan&& comp) { return std::partial_sort_copy(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), container_algorithm_internal::c_begin(result), @@ -1202,9 +1165,8 @@ // to return the first element within a container that is not sorted in // ascending order as an iterator. template <typename C> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_is_sorted_until(C& c) { +constexpr container_algorithm_internal::ContainerIter<C> c_is_sorted_until( + C& c) { return std::is_sorted_until(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1212,9 +1174,8 @@ // Overload of c_is_sorted_until() for performing a `comp` comparison other than // the default `operator<`. template <typename C, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<C> - c_is_sorted_until(C& c, LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIter<C> c_is_sorted_until( + C& c, LessThan&& comp) { return std::is_sorted_until(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<LessThan>(comp)); @@ -1228,7 +1189,7 @@ // any order, except that all preceding `nth` will be less than that element, // and all following `nth` will be greater than that element. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_nth_element( +constexpr void c_nth_element( RandomAccessContainer& sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> nth) { std::nth_element(container_algorithm_internal::c_begin(sequence), nth, @@ -1238,7 +1199,7 @@ // Overload of c_nth_element() for performing a `comp` comparison other than // the default `operator<`. template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_nth_element( +constexpr void c_nth_element( RandomAccessContainer& sequence, container_algorithm_internal::ContainerIter<RandomAccessContainer> nth, LessThan&& comp) { @@ -1257,9 +1218,8 @@ // to return an iterator pointing to the first element in a sorted container // which does not compare less than `value`. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_lower_bound(Sequence& sequence, const T& value) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_lower_bound( + Sequence& sequence, const T& value) { return std::lower_bound(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value); } @@ -1267,9 +1227,8 @@ // Overload of c_lower_bound() for performing a `comp` comparison other than // the default `operator<`. template <typename Sequence, typename T, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_lower_bound(Sequence& sequence, const T& value, LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_lower_bound( + Sequence& sequence, const T& value, LessThan&& comp) { return std::lower_bound(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value, std::forward<LessThan>(comp)); @@ -1281,9 +1240,8 @@ // to return an iterator pointing to the first element in a sorted container // which is greater than `value`. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_upper_bound(Sequence& sequence, const T& value) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_upper_bound( + Sequence& sequence, const T& value) { return std::upper_bound(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value); } @@ -1291,9 +1249,8 @@ // Overload of c_upper_bound() for performing a `comp` comparison other than // the default `operator<`. template <typename Sequence, typename T, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<Sequence> - c_upper_bound(Sequence& sequence, const T& value, LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIter<Sequence> c_upper_bound( + Sequence& sequence, const T& value, LessThan&& comp) { return std::upper_bound(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value, std::forward<LessThan>(comp)); @@ -1305,9 +1262,9 @@ // to return an iterator pair pointing to the first and last elements in a // sorted container which compare equal to `value`. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIterPairType<Sequence, Sequence> - c_equal_range(Sequence& sequence, const T& value) { +constexpr container_algorithm_internal::ContainerIterPairType<Sequence, + Sequence> +c_equal_range(Sequence& sequence, const T& value) { return std::equal_range(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value); } @@ -1315,9 +1272,9 @@ // Overload of c_equal_range() for performing a `comp` comparison other than // the default `operator<`. template <typename Sequence, typename T, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIterPairType<Sequence, Sequence> - c_equal_range(Sequence& sequence, const T& value, LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIterPairType<Sequence, + Sequence> +c_equal_range(Sequence& sequence, const T& value, LessThan&& comp) { return std::equal_range(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value, std::forward<LessThan>(comp)); @@ -1329,8 +1286,7 @@ // to test if any element in the sorted container contains a value equivalent to // 'value'. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_binary_search( - const Sequence& sequence, const T& value) { +constexpr bool c_binary_search(const Sequence& sequence, const T& value) { return std::binary_search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value); @@ -1339,8 +1295,8 @@ // Overload of c_binary_search() for performing a `comp` comparison other than // the default `operator<`. template <typename Sequence, typename T, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_binary_search( - const Sequence& sequence, const T& value, LessThan&& comp) { +constexpr bool c_binary_search(const Sequence& sequence, const T& value, + LessThan&& comp) { return std::binary_search(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value, std::forward<LessThan>(comp)); @@ -1355,8 +1311,8 @@ // Container-based version of the <algorithm> `std::merge()` function // to merge two sorted containers into a single sorted iterator. template <typename C1, typename C2, typename OutputIterator> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_merge(const C1& c1, const C2& c2, OutputIterator result) { +constexpr OutputIterator c_merge(const C1& c1, const C2& c2, + OutputIterator result) { return std::merge(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1366,8 +1322,8 @@ // Overload of c_merge() for performing a `comp` comparison other than // the default `operator<`. template <typename C1, typename C2, typename OutputIterator, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_merge(const C1& c1, const C2& c2, OutputIterator result, LessThan&& comp) { +constexpr OutputIterator c_merge(const C1& c1, const C2& c2, + OutputIterator result, LessThan&& comp) { return std::merge(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1403,8 +1359,7 @@ // to test whether a sorted container `c1` entirely contains another sorted // container `c2`. template <typename C1, typename C2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_includes(const C1& c1, - const C2& c2) { +constexpr bool c_includes(const C1& c1, const C2& c2) { return std::includes(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1414,8 +1369,7 @@ // Overload of c_includes() for performing a merge using a `comp` other than // `operator<`. template <typename C1, typename C2, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_includes(const C1& c1, const C2& c2, - LessThan&& comp) { +constexpr bool c_includes(const C1& c1, const C2& c2, LessThan&& comp) { return std::includes(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1435,8 +1389,8 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_set_union(const C1& c1, const C2& c2, OutputIterator output) { +constexpr OutputIterator c_set_union(const C1& c1, const C2& c2, + OutputIterator output) { return std::set_union(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1452,8 +1406,8 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_set_union( - const C1& c1, const C2& c2, OutputIterator output, LessThan&& comp) { +constexpr OutputIterator c_set_union(const C1& c1, const C2& c2, + OutputIterator output, LessThan&& comp) { return std::set_union(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1472,8 +1426,8 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_set_intersection(const C1& c1, const C2& c2, OutputIterator output) { +constexpr OutputIterator c_set_intersection(const C1& c1, const C2& c2, + OutputIterator output) { // In debug builds, ensure that both containers are sorted with respect to the // default comparator. std::set_intersection requires the containers be sorted // using operator<. @@ -1494,8 +1448,9 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_set_intersection( - const C1& c1, const C2& c2, OutputIterator output, LessThan&& comp) { +constexpr OutputIterator c_set_intersection(const C1& c1, const C2& c2, + OutputIterator output, + LessThan&& comp) { // In debug builds, ensure that both containers are sorted with respect to the // default comparator. std::set_intersection requires the containers be sorted // using the same comparator. @@ -1520,8 +1475,8 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_set_difference(const C1& c1, const C2& c2, OutputIterator output) { +constexpr OutputIterator c_set_difference(const C1& c1, const C2& c2, + OutputIterator output) { return std::set_difference(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1537,8 +1492,9 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_set_difference( - const C1& c1, const C2& c2, OutputIterator output, LessThan&& comp) { +constexpr OutputIterator c_set_difference(const C1& c1, const C2& c2, + OutputIterator output, + LessThan&& comp) { return std::set_difference(container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), container_algorithm_internal::c_begin(c2), @@ -1558,8 +1514,8 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator -c_set_symmetric_difference(const C1& c1, const C2& c2, OutputIterator output) { +constexpr OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2, + OutputIterator output) { return std::set_symmetric_difference( container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), @@ -1576,8 +1532,9 @@ typename = typename std::enable_if< !container_algorithm_internal::IsUnorderedContainer<C2>::value, void>::type> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIterator c_set_symmetric_difference( - const C1& c1, const C2& c2, OutputIterator output, LessThan&& comp) { +constexpr OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2, + OutputIterator output, + LessThan&& comp) { return std::set_symmetric_difference( container_algorithm_internal::c_begin(c1), container_algorithm_internal::c_end(c1), @@ -1595,8 +1552,7 @@ // Container-based version of the <algorithm> `std::push_heap()` function // to push a value onto a container heap. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_push_heap( - RandomAccessContainer& sequence) { +constexpr void c_push_heap(RandomAccessContainer& sequence) { std::push_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1604,8 +1560,7 @@ // Overload of c_push_heap() for performing a push operation on a heap using a // `comp` other than `operator<`. template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_push_heap( - RandomAccessContainer& sequence, LessThan&& comp) { +constexpr void c_push_heap(RandomAccessContainer& sequence, LessThan&& comp) { std::push_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1616,8 +1571,7 @@ // Container-based version of the <algorithm> `std::pop_heap()` function // to pop a value from a heap container. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_pop_heap( - RandomAccessContainer& sequence) { +constexpr void c_pop_heap(RandomAccessContainer& sequence) { std::pop_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1625,8 +1579,7 @@ // Overload of c_pop_heap() for performing a pop operation on a heap using a // `comp` other than `operator<`. template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_pop_heap( - RandomAccessContainer& sequence, LessThan&& comp) { +constexpr void c_pop_heap(RandomAccessContainer& sequence, LessThan&& comp) { std::pop_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1637,8 +1590,7 @@ // Container-based version of the <algorithm> `std::make_heap()` function // to make a container a heap. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_make_heap( - RandomAccessContainer& sequence) { +constexpr void c_make_heap(RandomAccessContainer& sequence) { std::make_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1646,8 +1598,7 @@ // Overload of c_make_heap() for performing heap comparisons using a // `comp` other than `operator<` template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_make_heap( - RandomAccessContainer& sequence, LessThan&& comp) { +constexpr void c_make_heap(RandomAccessContainer& sequence, LessThan&& comp) { std::make_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1658,8 +1609,7 @@ // Container-based version of the <algorithm> `std::sort_heap()` function // to sort a heap into ascending order (after which it is no longer a heap). template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_sort_heap( - RandomAccessContainer& sequence) { +constexpr void c_sort_heap(RandomAccessContainer& sequence) { std::sort_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1667,8 +1617,7 @@ // Overload of c_sort_heap() for performing heap comparisons using a // `comp` other than `operator<` template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_sort_heap( - RandomAccessContainer& sequence, LessThan&& comp) { +constexpr void c_sort_heap(RandomAccessContainer& sequence, LessThan&& comp) { std::sort_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1679,8 +1628,7 @@ // Container-based version of the <algorithm> `std::is_heap()` function // to check whether the given container is a heap. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_heap( - const RandomAccessContainer& sequence) { +constexpr bool c_is_heap(const RandomAccessContainer& sequence) { return std::is_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1688,8 +1636,8 @@ // Overload of c_is_heap() for performing heap comparisons using a // `comp` other than `operator<` template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_is_heap( - const RandomAccessContainer& sequence, LessThan&& comp) { +constexpr bool c_is_heap(const RandomAccessContainer& sequence, + LessThan&& comp) { return std::is_heap(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1700,9 +1648,8 @@ // Container-based version of the <algorithm> `std::is_heap_until()` function // to find the first element in a given container which is not in heap order. template <typename RandomAccessContainer> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<RandomAccessContainer> - c_is_heap_until(RandomAccessContainer& sequence) { +constexpr container_algorithm_internal::ContainerIter<RandomAccessContainer> +c_is_heap_until(RandomAccessContainer& sequence) { return std::is_heap_until(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence)); } @@ -1710,9 +1657,8 @@ // Overload of c_is_heap_until() for performing heap comparisons using a // `comp` other than `operator<` template <typename RandomAccessContainer, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 - container_algorithm_internal::ContainerIter<RandomAccessContainer> - c_is_heap_until(RandomAccessContainer& sequence, LessThan&& comp) { +constexpr container_algorithm_internal::ContainerIter<RandomAccessContainer> +c_is_heap_until(RandomAccessContainer& sequence, LessThan&& comp) { return std::is_heap_until(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<LessThan>(comp)); @@ -1801,8 +1747,8 @@ // that capital letters ("A-Z") have ASCII values less than lowercase letters // ("a-z"). template <typename Sequence1, typename Sequence2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_lexicographical_compare( - const Sequence1& sequence1, const Sequence2& sequence2) { +constexpr bool c_lexicographical_compare(const Sequence1& sequence1, + const Sequence2& sequence2) { return std::lexicographical_compare( container_algorithm_internal::c_begin(sequence1), container_algorithm_internal::c_end(sequence1), @@ -1813,8 +1759,9 @@ // Overload of c_lexicographical_compare() for performing a lexicographical // comparison using a `comp` operator instead of `operator<`. template <typename Sequence1, typename Sequence2, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_lexicographical_compare( - const Sequence1& sequence1, const Sequence2& sequence2, LessThan&& comp) { +constexpr bool c_lexicographical_compare(const Sequence1& sequence1, + const Sequence2& sequence2, + LessThan&& comp) { return std::lexicographical_compare( container_algorithm_internal::c_begin(sequence1), container_algorithm_internal::c_end(sequence1), @@ -1829,7 +1776,7 @@ // to rearrange a container's elements into the next lexicographically greater // permutation. template <typename C> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_next_permutation(C& c) { +constexpr bool c_next_permutation(C& c) { return std::next_permutation(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1837,8 +1784,7 @@ // Overload of c_next_permutation() for performing a lexicographical // comparison using a `comp` operator instead of `operator<`. template <typename C, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_next_permutation(C& c, - LessThan&& comp) { +constexpr bool c_next_permutation(C& c, LessThan&& comp) { return std::next_permutation(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<LessThan>(comp)); @@ -1850,7 +1796,7 @@ // to rearrange a container's elements into the next lexicographically lesser // permutation. template <typename C> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_prev_permutation(C& c) { +constexpr bool c_prev_permutation(C& c) { return std::prev_permutation(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c)); } @@ -1858,8 +1804,7 @@ // Overload of c_prev_permutation() for performing a lexicographical // comparison using a `comp` operator instead of `operator<`. template <typename C, typename LessThan> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_prev_permutation(C& c, - LessThan&& comp) { +constexpr bool c_prev_permutation(C& c, LessThan&& comp) { return std::prev_permutation(container_algorithm_internal::c_begin(c), container_algorithm_internal::c_end(c), std::forward<LessThan>(comp)); @@ -1875,8 +1820,7 @@ // to compute successive values of `value`, as if incremented with `++value` // after each element is written, and write them to the container. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_iota(Sequence& sequence, - const T& value) { +constexpr void c_iota(Sequence& sequence, const T& value) { std::iota(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), value); } @@ -1891,8 +1835,7 @@ // std::decay_t<T>. As a user of this function you can casually read // this as "returns T by value" and assume it does the right thing. template <typename Sequence, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::decay_t<T> c_accumulate( - const Sequence& sequence, T&& init) { +constexpr std::decay_t<T> c_accumulate(const Sequence& sequence, T&& init) { return std::accumulate(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<T>(init)); @@ -1901,8 +1844,8 @@ // Overload of c_accumulate() for using a binary operations other than // addition for computing the accumulation. template <typename Sequence, typename T, typename BinaryOp> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::decay_t<T> c_accumulate( - const Sequence& sequence, T&& init, BinaryOp&& binary_op) { +constexpr std::decay_t<T> c_accumulate(const Sequence& sequence, T&& init, + BinaryOp&& binary_op) { return std::accumulate(container_algorithm_internal::c_begin(sequence), container_algorithm_internal::c_end(sequence), std::forward<T>(init), @@ -1918,8 +1861,8 @@ // std::decay_t<T>. As a user of this function you can casually read // this as "returns T by value" and assume it does the right thing. template <typename Sequence1, typename Sequence2, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::decay_t<T> c_inner_product( - const Sequence1& factors1, const Sequence2& factors2, T&& sum) { +constexpr std::decay_t<T> c_inner_product(const Sequence1& factors1, + const Sequence2& factors2, T&& sum) { return std::inner_product(container_algorithm_internal::c_begin(factors1), container_algorithm_internal::c_end(factors1), container_algorithm_internal::c_begin(factors2), @@ -1931,9 +1874,9 @@ // the product between the two container's element pair). template <typename Sequence1, typename Sequence2, typename T, typename BinaryOp1, typename BinaryOp2> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 std::decay_t<T> c_inner_product( - const Sequence1& factors1, const Sequence2& factors2, T&& sum, - BinaryOp1&& op1, BinaryOp2&& op2) { +constexpr std::decay_t<T> c_inner_product(const Sequence1& factors1, + const Sequence2& factors2, T&& sum, + BinaryOp1&& op1, BinaryOp2&& op2) { return std::inner_product(container_algorithm_internal::c_begin(factors1), container_algorithm_internal::c_end(factors1), container_algorithm_internal::c_begin(factors2), @@ -1947,8 +1890,8 @@ // function to compute the difference between each element and the one preceding // it and write it to an iterator. template <typename InputSequence, typename OutputIt> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIt -c_adjacent_difference(const InputSequence& input, OutputIt output_first) { +constexpr OutputIt c_adjacent_difference(const InputSequence& input, + OutputIt output_first) { return std::adjacent_difference(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output_first); @@ -1957,8 +1900,8 @@ // Overload of c_adjacent_difference() for using a binary operation other than // subtraction to compute the adjacent difference. template <typename InputSequence, typename OutputIt, typename BinaryOp> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIt c_adjacent_difference( - const InputSequence& input, OutputIt output_first, BinaryOp&& op) { +constexpr OutputIt c_adjacent_difference(const InputSequence& input, + OutputIt output_first, BinaryOp&& op) { return std::adjacent_difference(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output_first, std::forward<BinaryOp>(op)); @@ -1971,8 +1914,8 @@ // to an iterator. The partial sum is the sum of all element values so far in // the sequence. template <typename InputSequence, typename OutputIt> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIt -c_partial_sum(const InputSequence& input, OutputIt output_first) { +constexpr OutputIt c_partial_sum(const InputSequence& input, + OutputIt output_first) { return std::partial_sum(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output_first); @@ -1981,8 +1924,8 @@ // Overload of c_partial_sum() for using a binary operation other than addition // to compute the "partial sum". template <typename InputSequence, typename OutputIt, typename BinaryOp> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 OutputIt c_partial_sum( - const InputSequence& input, OutputIt output_first, BinaryOp&& op) { +constexpr OutputIt c_partial_sum(const InputSequence& input, + OutputIt output_first, BinaryOp&& op) { return std::partial_sum(container_algorithm_internal::c_begin(input), container_algorithm_internal::c_end(input), output_first, std::forward<BinaryOp>(op));
diff --git a/absl/base/config.h b/absl/base/config.h index 7bb1c99..4a35ff1 100644 --- a/absl/base/config.h +++ b/absl/base/config.h
@@ -826,21 +826,6 @@ #define ABSL_HAVE_CONSTANT_EVALUATED 1 #endif -// ABSL_INTERNAL_CONSTEXPR_SINCE_CXXYY is used to conditionally define constexpr -// for different C++ versions. -// -// These macros are an implementation detail and will be unconditionally removed -// once the minimum supported C++ version catches up to a given version. -// -// For this reason, this symbol is considered INTERNAL and code outside of -// Abseil must not use it. -#if defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \ - ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L -#define ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 constexpr -#else -#define ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 -#endif - // ABSL_INTERNAL_EMSCRIPTEN_VERSION combines Emscripten's three version macros // into an integer that can be compared against. #ifdef ABSL_INTERNAL_EMSCRIPTEN_VERSION
diff --git a/absl/types/internal/span.h b/absl/types/internal/span.h index 208216c..711fdef 100644 --- a/absl/types/internal/span.h +++ b/absl/types/internal/span.h
@@ -86,13 +86,13 @@ typename std::enable_if<!std::is_const<T>::value, int>::type; template <template <typename> class SpanT, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool EqualImpl(SpanT<T> a, SpanT<T> b) { +constexpr bool EqualImpl(SpanT<T> a, SpanT<T> b) { static_assert(std::is_const<T>::value, ""); return std::equal(a.begin(), a.end(), b.begin(), b.end()); } template <template <typename> class SpanT, typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool LessThanImpl(SpanT<T> a, SpanT<T> b) { +constexpr bool LessThanImpl(SpanT<T> a, SpanT<T> b) { // We can't use value_type since that is remove_cv_t<T>, so we go the long way // around. static_assert(std::is_const<T>::value, "");
diff --git a/absl/types/span.h b/absl/types/span.h index 2327962..e2f0c9a 100644 --- a/absl/types/span.h +++ b/absl/types/span.h
@@ -531,165 +531,157 @@ // operator== template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator==(Span<T> a, Span<T> b) { +constexpr bool operator==(Span<T> a, Span<T> b) { return span_internal::EqualImpl<Span, const T>(a, b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator==(Span<const T> a, - Span<T> b) { +constexpr bool operator==(Span<const T> a, Span<T> b) { return span_internal::EqualImpl<Span, const T>(a, b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator==(Span<T> a, - Span<const T> b) { +constexpr bool operator==(Span<T> a, Span<const T> b) { return span_internal::EqualImpl<Span, const T>(a, b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator==(const U& a, Span<T> b) { +constexpr bool operator==(const U& a, Span<T> b) { return span_internal::EqualImpl<Span, const T>(a, b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator==(Span<T> a, const U& b) { +constexpr bool operator==(Span<T> a, const U& b) { return span_internal::EqualImpl<Span, const T>(a, b); } // operator!= template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator!=(Span<T> a, Span<T> b) { +constexpr bool operator!=(Span<T> a, Span<T> b) { return !(a == b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator!=(Span<const T> a, - Span<T> b) { +constexpr bool operator!=(Span<const T> a, Span<T> b) { return !(a == b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator!=(Span<T> a, - Span<const T> b) { +constexpr bool operator!=(Span<T> a, Span<const T> b) { return !(a == b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator!=(const U& a, Span<T> b) { +constexpr bool operator!=(const U& a, Span<T> b) { return !(a == b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator!=(Span<T> a, const U& b) { +constexpr bool operator!=(Span<T> a, const U& b) { return !(a == b); } // operator< template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<(Span<T> a, Span<T> b) { +constexpr bool operator<(Span<T> a, Span<T> b) { return span_internal::LessThanImpl<Span, const T>(a, b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<(Span<const T> a, Span<T> b) { +constexpr bool operator<(Span<const T> a, Span<T> b) { return span_internal::LessThanImpl<Span, const T>(a, b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<(Span<T> a, Span<const T> b) { +constexpr bool operator<(Span<T> a, Span<const T> b) { return span_internal::LessThanImpl<Span, const T>(a, b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<(const U& a, Span<T> b) { +constexpr bool operator<(const U& a, Span<T> b) { return span_internal::LessThanImpl<Span, const T>(a, b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<(Span<T> a, const U& b) { +constexpr bool operator<(Span<T> a, const U& b) { return span_internal::LessThanImpl<Span, const T>(a, b); } // operator> template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>(Span<T> a, Span<T> b) { +constexpr bool operator>(Span<T> a, Span<T> b) { return b < a; } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>(Span<const T> a, Span<T> b) { +constexpr bool operator>(Span<const T> a, Span<T> b) { return b < a; } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>(Span<T> a, Span<const T> b) { +constexpr bool operator>(Span<T> a, Span<const T> b) { return b < a; } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>(const U& a, Span<T> b) { +constexpr bool operator>(const U& a, Span<T> b) { return b < a; } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>(Span<T> a, const U& b) { +constexpr bool operator>(Span<T> a, const U& b) { return b < a; } // operator<= template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<=(Span<T> a, Span<T> b) { +constexpr bool operator<=(Span<T> a, Span<T> b) { return !(b < a); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<=(Span<const T> a, - Span<T> b) { +constexpr bool operator<=(Span<const T> a, Span<T> b) { return !(b < a); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<=(Span<T> a, - Span<const T> b) { +constexpr bool operator<=(Span<T> a, Span<const T> b) { return !(b < a); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<=(const U& a, Span<T> b) { +constexpr bool operator<=(const U& a, Span<T> b) { return !(b < a); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator<=(Span<T> a, const U& b) { +constexpr bool operator<=(Span<T> a, const U& b) { return !(b < a); } // operator>= template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>=(Span<T> a, Span<T> b) { +constexpr bool operator>=(Span<T> a, Span<T> b) { return !(a < b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>=(Span<const T> a, - Span<T> b) { +constexpr bool operator>=(Span<const T> a, Span<T> b) { return !(a < b); } template <typename T> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>=(Span<T> a, - Span<const T> b) { +constexpr bool operator>=(Span<T> a, Span<const T> b) { return !(a < b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>=(const U& a, Span<T> b) { +constexpr bool operator>=(const U& a, Span<T> b) { return !(a < b); } template < typename T, typename U, typename = span_internal::EnableIfConvertibleTo<U, absl::Span<const T>>> -ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool operator>=(Span<T> a, const U& b) { +constexpr bool operator>=(Span<T> a, const U& b) { return !(a < b); }