Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 5 additions & 9 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -5185,16 +5185,12 @@ _SampleIt sample(_PopIt _First, _PopIt _Last, _SampleIt _Dest, _Diff _Count, _Ur
}

#ifdef __cpp_lib_concepts
// clang-format off
_EXPORT_STD template <class _Ty>
concept uniform_random_bit_generator = invocable<_Ty&>
&& unsigned_integral<invoke_result_t<_Ty&>>
&& requires {
{ (_Ty::min)() } -> same_as<invoke_result_t<_Ty&>>;
{ (_Ty::max)() } -> same_as<invoke_result_t<_Ty&>>;
requires bool_constant<(_Ty::min)() < (_Ty::max)()>::value;
};
// clang-format on
concept uniform_random_bit_generator = invocable<_Ty&> && unsigned_integral<invoke_result_t<_Ty&>> && requires {
{ (_Ty::min)() } -> same_as<invoke_result_t<_Ty&>>;
{ (_Ty::max)() } -> same_as<invoke_result_t<_Ty&>>;
requires bool_constant<(_Ty::min)() < (_Ty::max)()>::value;
};

namespace ranges {
class _Sample_fn {
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ struct _Auto_id_tag {
explicit _Auto_id_tag() = default;
};

// clang-format off
template <class _Ty, class _CharT>
concept _Parse_arg_id_callbacks = requires(_Ty _At) {
{ _At._On_auto_id() } -> same_as<void>;
Expand Down Expand Up @@ -184,6 +183,7 @@ concept _Precision_adapter_callbacks = requires(_Ty _At) {
{ _At._On_dynamic_precision(size_t{}) } -> same_as<void>;
};

// clang-format off
template <class _Ty, class _CharT>
concept _Parse_spec_callbacks = _Parse_align_callbacks<_Ty, _CharT>
&& _Parse_width_callbacks<_Ty, _CharT>
Expand Down
7 changes: 3 additions & 4 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,11 @@ public:
return *_Val._Get_first();
}

// clang-format off
_NODISCARD constexpr auto operator->() const
requires indirectly_readable<const _Iter>
&& (_Has_member_arrow<const _Iter&> || is_reference_v<iter_reference_t<_Iter>>
|| constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>>) {
// clang-format on
&& (_Has_member_arrow<const _Iter&> || is_reference_v<iter_reference_t<_Iter>>
|| constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>>)
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Val._Contains == _Variantish_state::_Holds_first,
"common_iterator can only be dereferenced if it holds an iterator");
Expand Down
10 changes: 3 additions & 7 deletions stl/inc/optional
Original file line number Diff line number Diff line change
Expand Up @@ -930,14 +930,10 @@ _NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _R
}

#ifdef __cpp_lib_concepts
// clang-format off
_EXPORT_STD template <class _Ty1, class _Ty2>
requires (!_Derived_from_specialization_of<_Ty2, optional>)
&& three_way_comparable_with<_Ty1, _Ty2>
_NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2>
operator<=>(const optional<_Ty1>& _Left, const _Ty2& _Right)
noexcept(noexcept(*_Left <=> _Right)) /* strengthened */ {
// clang-format on
requires (!_Derived_from_specialization_of<_Ty2, optional>) && three_way_comparable_with<_Ty1, _Ty2>
_NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(
const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept(noexcept(*_Left <=> _Right)) /* strengthened */ {
if (_Left) {
return *_Left <=> _Right;
}
Expand Down
439 changes: 177 additions & 262 deletions stl/inc/ranges

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions stl/inc/spanstream
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,12 @@ public:
}

#ifdef __cpp_lib_concepts
// clang-format off
template <_RANGES borrowed_range _ReadOnlyRange>
requires (!convertible_to<_ReadOnlyRange, _STD span<_Elem>>
&& convertible_to<_ReadOnlyRange, _STD span<const _Elem>>)
requires (
!convertible_to<_ReadOnlyRange, _STD span<_Elem>> && convertible_to<_ReadOnlyRange, _STD span<const _Elem>>)
explicit basic_ispanstream(_ReadOnlyRange&& _Range)
: basic_ispanstream(
_STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast<size_t>(_RANGES size(_Range))}) {}
// clang-format on
#endif // defined(__cpp_lib_concepts)

basic_ispanstream& operator=(const basic_ispanstream&) = delete;
Expand Down Expand Up @@ -254,15 +252,13 @@ public:
}

#ifdef __cpp_lib_concepts
// clang-format off
template <_RANGES borrowed_range _ReadOnlyRange>
requires (!convertible_to<_ReadOnlyRange, _STD span<_Elem>>
&& convertible_to<_ReadOnlyRange, _STD span<const _Elem>>)
requires (
!convertible_to<_ReadOnlyRange, _STD span<_Elem>> && convertible_to<_ReadOnlyRange, _STD span<const _Elem>>)
void span(_ReadOnlyRange&& _Range) noexcept {
this->span(
_STD span<_Elem>{const_cast<_Elem*>(_RANGES data(_Range)), static_cast<size_t>(_RANGES size(_Range))});
}
// clang-format on
#endif // defined(__cpp_lib_concepts)

private:
Expand Down
Loading