Thanks to visit codestin.com
Credit goes to github.com

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
46 changes: 23 additions & 23 deletions stl/inc/__msvc_iter_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct incrementable_traits<const _Ty> : incrementable_traits<_Ty> {};

template <_Has_member_difference_type _Ty>
struct incrementable_traits<_Ty> {
using difference_type = typename _Ty::difference_type;
using difference_type = _Ty::difference_type;
};

template <class _Ty>
Expand All @@ -117,7 +117,7 @@ _EXPORT_STD template <class>
struct iterator_traits;

_EXPORT_STD template <class _Ty>
using iter_difference_t = typename conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
using iter_difference_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
incrementable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::difference_type;

template <class>
Expand Down Expand Up @@ -160,7 +160,7 @@ template <_Has_member_value_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};

_EXPORT_STD template <class _Ty>
using iter_value_t = typename conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
using iter_value_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
indirectly_readable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::value_type;

_EXPORT_STD template <_Dereferenceable _Ty>
Expand All @@ -176,7 +176,7 @@ concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_
template <bool _Has_member_typedef>
struct _Old_iter_traits_pointer {
template <class _It>
using _Apply = typename _It::pointer;
using _Apply = _It::pointer;
};

template <>
Expand All @@ -187,17 +187,17 @@ struct _Old_iter_traits_pointer<false> {

template <_Has_iter_types _It>
struct _Iterator_traits_base<_It> {
using iterator_category = typename _It::iterator_category;
using value_type = typename _It::value_type;
using difference_type = typename _It::difference_type;
using pointer = typename _Old_iter_traits_pointer<_Has_member_pointer<_It>>::template _Apply<_It>;
using reference = typename _It::reference;
using iterator_category = _It::iterator_category;
using value_type = _It::value_type;
using difference_type = _It::difference_type;
using pointer = _Old_iter_traits_pointer<_Has_member_pointer<_It>>::template _Apply<_It>;
using reference = _It::reference;
};

template <bool _Has_member_typedef>
struct _Iter_traits_difference {
template <class _It>
using _Apply = typename incrementable_traits<_It>::difference_type;
using _Apply = incrementable_traits<_It>::difference_type;
};

template <>
Expand Down Expand Up @@ -233,7 +233,7 @@ struct _Iterator_traits_base<_It> {
using iterator_category = output_iterator_tag;
using value_type = void;
using difference_type =
typename _Iter_traits_difference<_Has_member_difference_type<incrementable_traits<_It>>>::template _Apply<_It>;
_Iter_traits_difference<_Has_member_difference_type<incrementable_traits<_It>>>::template _Apply<_It>;
using pointer = void;
using reference = void;
};
Expand All @@ -253,7 +253,7 @@ struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_void> {
template <>
struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_member> {
template <class _It>
using _Apply = typename _It::pointer;
using _Apply = _It::pointer;
};

template <>
Expand All @@ -268,7 +268,7 @@ concept _Has_member_arrow = requires(_Ty&& __t) { static_cast<_Ty&&>(__t).operat
template <bool _Has_member_typedef>
struct _Iter_traits_reference {
template <class _It>
using _Apply = typename _It::reference;
using _Apply = _It::reference;
};

template <>
Expand All @@ -290,7 +290,7 @@ struct _Iter_traits_category4<false> {
// clang-format off
template <class _It>
concept _Cpp17_random_delta = totally_ordered<_It>
&& requires(_It __i, typename incrementable_traits<_It>::difference_type __n) {
&& requires(_It __i, incrementable_traits<_It>::difference_type __n) {
{ __i += __n } -> same_as<_It&>;
{ __i -= __n } -> same_as<_It&>;
{ __i + __n } -> same_as<_It>;
Expand All @@ -304,7 +304,7 @@ concept _Cpp17_random_delta = totally_ordered<_It>
template <bool _Is_bidi>
struct _Iter_traits_category3 {
template <class _It>
using _Apply = typename _Iter_traits_category4<_Cpp17_random_delta<_It>>::type;
using _Apply = _Iter_traits_category4<_Cpp17_random_delta<_It>>::type;
};

template <>
Expand All @@ -323,7 +323,7 @@ concept _Cpp17_bidi_delta = requires(_It __i) {
template <bool _Is_forward>
struct _Iter_traits_category2 {
template <class _It>
using _Apply = typename _Iter_traits_category3<_Cpp17_bidi_delta<_It>>::template _Apply<_It>;
using _Apply = _Iter_traits_category3<_Cpp17_bidi_delta<_It>>::template _Apply<_It>;
};

template <>
Expand All @@ -345,27 +345,27 @@ concept _Cpp17_forward_delta = constructible_from<_It> && is_reference_v<iter_re
template <bool _Has_member_typedef>
struct _Iter_traits_category {
template <class _It>
using _Apply = typename _It::iterator_category;
using _Apply = _It::iterator_category;
};

template <>
struct _Iter_traits_category<false> {
template <class _It>
using _Apply = typename _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>;
using _Apply = _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>;
};

// clang-format off
template <class _It>
requires (!_Has_iter_types<_It> && _Cpp17_input_iterator<_It>)
struct _Iterator_traits_base<_It> {
using iterator_category = typename _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>;
using value_type = typename indirectly_readable_traits<_It>::value_type;
using difference_type = typename incrementable_traits<_It>::difference_type;
using pointer = typename _Iter_traits_pointer<(
using iterator_category = _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>;
using value_type = indirectly_readable_traits<_It>::value_type;
using difference_type = incrementable_traits<_It>::difference_type;
using pointer = _Iter_traits_pointer<(
_Has_member_pointer<_It> ? _Itraits_pointer_strategy::_Use_member
: _Has_member_arrow<_It&> ? _Itraits_pointer_strategy::_Use_decltype
: _Itraits_pointer_strategy::_Use_void)>::template _Apply<_It>;
using reference = typename _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>;
using reference = _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>;
};
// clang-format on

Expand Down
6 changes: 3 additions & 3 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ struct iterator_traits<common_iterator<_Iter, _Se>> : _Common_iterator_category_
using iterator_concept = conditional_t<forward_iterator<_Iter>, forward_iterator_tag, input_iterator_tag>;
using value_type = iter_value_t<_Iter>;
using difference_type = iter_difference_t<_Iter>;
using pointer = typename _Common_iterator_pointer_type<_Iter, _Se>::pointer;
using pointer = _Common_iterator_pointer_type<_Iter, _Se>::pointer;
using reference = iter_reference_t<_Iter>;
};

Expand All @@ -1134,15 +1134,15 @@ struct _Counted_iterator_category_base : _Counted_iterator_value_type_base<_Iter

template <_Has_member_iterator_category _Iter>
struct _Counted_iterator_category_base<_Iter> : _Counted_iterator_value_type_base<_Iter> {
using iterator_category = typename _Iter::iterator_category;
using iterator_category = _Iter::iterator_category;
};

template <class _Iter>
struct _Counted_iterator_concept_base : _Counted_iterator_category_base<_Iter> {};

template <_Has_member_iterator_concept _Iter>
struct _Counted_iterator_concept_base<_Iter> : _Counted_iterator_category_base<_Iter> {
using iterator_concept = typename _Iter::iterator_concept;
using iterator_concept = _Iter::iterator_concept;
};

_EXPORT_STD template <input_or_output_iterator _Iter>
Expand Down
2 changes: 1 addition & 1 deletion tests/std/include/range_algorithm_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ namespace test {
return elements_.data();
}

using UI = typename I::unwrap;
using UI = I::unwrap;
using US = conditional_t<to_bool(IsCommon), UI, sentinel<Element, WrappedState::unwrapped>>;

[[nodiscard]] constexpr UI _Unchecked_begin() const noexcept {
Expand Down
4 changes: 2 additions & 2 deletions tests/std/include/test_mdspan_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ inline constexpr bool is_permissive = details::PermissiveTest<int>::test();

template <class Mapping>
struct MappingProperties {
typename Mapping::index_type req_span_size;
Mapping::index_type req_span_size;
bool uniqueness;
bool exhaustiveness;
bool strideness;
Expand All @@ -267,7 +267,7 @@ struct MappingProperties {
template <class Mapping>
requires (!details::PermissiveTest<Mapping>::test())
MappingProperties<Mapping> get_mapping_properties(const Mapping& mapping) {
using IndexType = typename Mapping::index_type;
using IndexType = Mapping::index_type;
constexpr auto rank = Mapping::extents_type::rank();
constexpr std::make_index_sequence<rank> rank_indices;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ static_assert(is_destructible_v<syncbuf>);
template <class Elem, class Traits, class Alloc>
class test_syncbuf : public basic_syncbuf<Elem, Traits, Alloc> {
public:
using size_type = typename Alloc::size_type;
using value_type = typename Alloc::value_type;
using size_type = Alloc::size_type;
using value_type = Alloc::value_type;
using Mybase = basic_syncbuf<Elem, Traits, Alloc>;
using streambuf_type = typename Mybase::streambuf_type;
using streambuf_type = Mybase::streambuf_type;

using Mybase::epptr;
using Mybase::pbase;
Expand Down Expand Up @@ -49,7 +49,7 @@ class test_syncbuf : public basic_syncbuf<Elem, Traits, Alloc> {
template <class Alloc>
void test_syncbuf_member_functions(string_buffer<typename Alloc::value_type>* buf = nullptr) {

using value_type = typename Alloc::value_type;
using value_type = Alloc::value_type;
using Syncbuf = test_syncbuf<value_type, char_traits<value_type>, Alloc>;
using OStream = basic_ostream<value_type, char_traits<value_type>>;

Expand Down Expand Up @@ -124,7 +124,7 @@ template <class Alloc, bool ThrowOnSync = false>
void test_syncbuf_synchronization(string_buffer<typename Alloc::value_type, ThrowOnSync>* buf) {
assert(buf); // meaningless to run with nullptr

using value_type = typename Alloc::value_type;
using value_type = Alloc::value_type;
using Syncbuf = test_syncbuf<value_type, char_traits<value_type>, Alloc>;
using OStream = basic_ostream<value_type, char_traits<value_type>>;

Expand Down Expand Up @@ -182,7 +182,7 @@ void test_syncbuf_synchronization(string_buffer<typename Alloc::value_type, Thro
template <class Alloc>
void test_syncbuf_move_swap_operations(string_buffer<typename Alloc::value_type>* buf) {

using value_type = typename Alloc::value_type;
using value_type = Alloc::value_type;
using Syncbuf = test_syncbuf<value_type, char_traits<value_type>, Alloc>;
using OStream = basic_ostream<value_type, char_traits<value_type>>;

Expand Down Expand Up @@ -261,7 +261,7 @@ void test_syncbuf_move_swap_operations(string_buffer<typename Alloc::value_type>

template <class Alloc>
void test_osyncstream(string_buffer<typename Alloc::value_type>* buf = nullptr) {
using value_type = typename Alloc::value_type;
using value_type = Alloc::value_type;
using OSyncStream = basic_osyncstream<value_type, char_traits<value_type>, Alloc>;

{
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0631R8_numbers_math_constants/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct apply_modify_cv<modify_cv::add_cv, T> {
};

template <modify_cv Modification, class T>
using apply_modify_cv_t = typename apply_modify_cv<Modification, T>::type;
using apply_modify_cv_t = apply_modify_cv<Modification, T>::type;

template <modify_cv Modification>
constexpr void test_cv_floating_point() {
Expand Down
6 changes: 3 additions & 3 deletions tests/std/tests/P0645R10_text_formatting_args/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum class Arg_type : uint8_t {
template <class Context>
constexpr auto visitor = [](auto&& arg) {
using T = decay_t<decltype(arg)>;
using char_type = typename Context::char_type;
using char_type = Context::char_type;
if constexpr (is_same_v<T, monostate>) {
return Arg_type::none;
} else if constexpr (is_same_v<T, int>) {
Expand Down Expand Up @@ -84,7 +84,7 @@ constexpr auto visitor = [](auto&& arg) {

template <class Context>
void test_basic_format_arg() {
using char_type = typename Context::char_type;
using char_type = Context::char_type;

{ // construction
basic_format_arg<Context> default_constructed;
Expand Down Expand Up @@ -161,7 +161,7 @@ void test_single_format_arg(Type value) {

template <class Context>
void test_format_arg_store() {
using char_type = typename Context::char_type;
using char_type = Context::char_type;

test_empty_format_arg<Context>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void test_mixed_custom_formattable_type() {

template <class OutIt, class CharT>
void test_basic_format_arg_handle_construction() {
using handle = typename basic_format_arg<basic_format_context<OutIt, CharT>>::handle;
using handle = basic_format_arg<basic_format_context<OutIt, CharT>>::handle;

static_assert(is_constructible_v<handle, int&>);
static_assert(is_constructible_v<handle, const int&>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class string_buffer : public basic_streambuf<Ty, char_traits<Ty>> { // represent
template <class Ty, class Alloc = void, bool ThrowOnSync = false>
void test_osyncstream_manipulators(
string_buffer<typename Ty::char_type, ThrowOnSync>* buf = nullptr, bool buffer_can_sync = true) {
using char_type = typename Ty::char_type;
using traits_type = typename Ty::traits_type;
using char_type = Ty::char_type;
using traits_type = Ty::traits_type;

static_assert(is_base_of_v<basic_ostream<char_type, traits_type>, Ty>);

Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0768R1_spaceship_cpos/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct CpoResultImpl<CPO, E, F> {
};

template <const auto& CPO, typename E, typename F = E>
using CpoResult = typename CpoResultImpl<CPO, E, F>::type;
using CpoResult = CpoResultImpl<CPO, E, F>::type;

template <const auto& CPO, typename E, typename F = E>
inline constexpr bool NoexceptCpo = noexcept(CPO(declval<E>(), declval<F>()));
Expand Down
8 changes: 4 additions & 4 deletions tests/std/tests/P0896R4_common_iterator/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct instantiator {
template <input_or_output_iterator Iter>
static constexpr void call() {
if constexpr (copyable<Iter>) {
using ConstIter = typename Iter::Consterator;
using ConstIter = Iter::Consterator;
using Sen = test::sentinel<iter_value_t<Iter>>;
using OSen = test::sentinel<const iter_value_t<Iter>>;
using Cit = common_iterator<Iter, Sen>;
Expand All @@ -43,21 +43,21 @@ struct instantiator {

// [common.iter.types]
{
using iconcept = typename iterator_traits<Cit>::iterator_concept;
using iconcept = iterator_traits<Cit>::iterator_concept;
if constexpr (forward_iterator<Iter>) {
STATIC_ASSERT(same_as<iconcept, forward_iterator_tag>);
} else {
STATIC_ASSERT(same_as<typename iterator_traits<Cit>::iterator_concept, input_iterator_tag>);
}

using icat = typename iterator_traits<Cit>::iterator_category;
using icat = iterator_traits<Cit>::iterator_category;
if constexpr (derived_from<icat, forward_iterator_tag>) {
STATIC_ASSERT(same_as<icat, forward_iterator_tag>);
} else {
STATIC_ASSERT(same_as<icat, input_iterator_tag>);
}

using ipointer = typename iterator_traits<Cit>::pointer;
using ipointer = iterator_traits<Cit>::pointer;
if constexpr (CanArrow<Cit>) {
STATIC_ASSERT(same_as<ipointer, decltype(declval<const Cit&>().operator->())>);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0896R4_counted_iterator/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ concept CountedCompare = Counted<I1, I2>
struct instantiator {
template <input_or_output_iterator Iter>
static constexpr void call() {
using ConstIter = typename Iter::Consterator;
using ConstIter = Iter::Consterator;

int input[5] = {1, 2, 3, 4, 5};
// [counted.iter.const]
Expand Down
8 changes: 4 additions & 4 deletions tests/std/tests/P0896R4_ranges_range_machinery/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,18 +773,18 @@ constexpr bool is_forward_list<std::forward_list<T, A>> = true;

template <class T, class IterConcept>
constexpr bool test_std_container() {
using I = typename T::iterator;
using I = T::iterator;
using D = std::iter_difference_t<I>;
using CI = typename T::const_iterator;
using CI = T::const_iterator;
STATIC_ASSERT(std::same_as<std::iter_difference_t<CI>, D>);

using Category = typename std::iterator_traits<I>::iterator_category;
using Category = std::iterator_traits<I>::iterator_category;
STATIC_ASSERT(std::derived_from<IterConcept, Category>);

using RI = std::conditional_t<std::bidirectional_iterator<I>, std::reverse_iterator<I>, invalid_type>;
using RCI = std::conditional_t<std::bidirectional_iterator<I>, std::reverse_iterator<CI>, invalid_type>;

using V = typename T::value_type;
using V = T::value_type;

STATIC_ASSERT(test_begin<T>());
STATIC_ASSERT(test_end<T>());
Expand Down
Loading