Skip to content

<ranges>: Cleanup for _CONSTEVAL #3639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -9254,7 +9254,7 @@ namespace ranges {
is_nothrow_move_constructible_v<_Inner_iterator<_Const>>) // strengthened
: _Parent(_STD addressof(_Parent_)), _Inner(_STD move(_Inner_)) {}

_NODISCARD static _CONSTEVAL auto _Get_iterator_category() noexcept {
_NODISCARD static consteval auto _Get_iterator_category() noexcept {
if constexpr (!is_reference_v<_Invoke_result_with_repeated_type<_Maybe_const<_Const, _Fn>&,
range_reference_t<_Base>, _Nx>>) {
return input_iterator_tag{};
Expand All @@ -9274,7 +9274,7 @@ namespace ranges {
}

template <size_t... _Indices>
_NODISCARD static _CONSTEVAL bool _Is_indirection_nothrow(index_sequence<_Indices...>) noexcept {
_NODISCARD static consteval bool _Is_indirection_nothrow(index_sequence<_Indices...>) noexcept {
return noexcept(_STD invoke(_STD declval<_Maybe_const<_Const, _Fn>&>(),
*_STD get<_Indices>(_STD declval<const _Inner_iterator<_Const>&>()._Current)...));
}
Expand Down Expand Up @@ -9712,7 +9712,7 @@ namespace ranges {
inline constexpr auto _Compile_time_max_size<const owning_view<_Ty>> = _Compile_time_max_size<const _Ty>;

template <range _Rng>
_NODISCARD _CONSTEVAL int _Cartesian_product_max_size_bit_width() noexcept {
_NODISCARD consteval int _Cartesian_product_max_size_bit_width() noexcept {
if constexpr (sized_range<_Rng>) {
if constexpr (requires(range_size_t<_Rng> _Val) { _STD bit_width(_Val); }) {
return _STD bit_width(_Compile_time_max_size<_Rng>);
Expand All @@ -9725,7 +9725,7 @@ namespace ranges {
}

template <class _First, class... _Rest>
_NODISCARD _CONSTEVAL auto _Cartesian_product_optimal_size_type() noexcept {
_NODISCARD consteval auto _Cartesian_product_optimal_size_type() noexcept {
constexpr int _Optimal_size_type_bit_width =
(_Cartesian_product_max_size_bit_width<_First>() + ... + _Cartesian_product_max_size_bit_width<_Rest>());
if constexpr (_Optimal_size_type_bit_width <= 8) {
Expand Down Expand Up @@ -9876,7 +9876,7 @@ namespace ranges {
}

template <size_t... _Indices>
_NODISCARD static _CONSTEVAL bool _Is_iter_move_nothrow(index_sequence<_Indices...>) noexcept {
_NODISCARD static consteval bool _Is_iter_move_nothrow(index_sequence<_Indices...>) noexcept {
return conjunction_v<
is_nothrow_move_constructible<range_rvalue_reference_t<_Maybe_const<_Const, _First>>>,
is_nothrow_move_constructible<range_rvalue_reference_t<_Maybe_const<_Const, _Rest>>>...>
Expand All @@ -9885,7 +9885,7 @@ namespace ranges {
}

template <size_t... _Indices>
_NODISCARD static _CONSTEVAL bool _Is_iter_swap_nothrow(index_sequence<_Indices...>) noexcept {
_NODISCARD static consteval bool _Is_iter_swap_nothrow(index_sequence<_Indices...>) noexcept {
return (noexcept(_RANGES iter_swap(_STD get<_Indices>(_STD declval<const _Iterator&>()._Current),
_STD get<_Indices>(_STD declval<const _Iterator&>()._Current)))
&& ...);
Expand Down