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

Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

Fixes #943. Fixes #951.

This PR

  • introduces convertibility from (un)checked_array_iterator<T*> to (un)checked_array_iterator<const T*>,
  • deprecates (un)checked_array_iterator and make_(un)checked_array_iterator in C++17 and later modes, while allowing users to define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING to suppress the deprecation,
  • diagnoses (un)checked_array_iterator<void*> and (un)checked_array_iterator<Ret(*)(Args...)> in static_assert,
  • expands iterator_traits<Ptr>::meow typedefs,
  • uses default member initializers for default construction,
  • strengthens exception specification for make_checked_array_iterator, and
  • ensures that (un)checked_array_iterator are contiguous iterators in C++20.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner June 21, 2023 16:55
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Jun 21, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jun 23, 2023
Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll validate and push changes.

"warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory " \
"functions are non-Standard extensions and will be removed in future. std::span (since C++20) and gsl::span " \
"can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or " \
"_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.")]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is debatable whether this should be controlled by the coarse-grained _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS as this is a Microsoft deprecation, not an ISO deprecation. On the other hand, guarding this with _HAS_CXX17 will significantly limit the impact on legacy code (which is good). I suppose I am fine with this; the precedent doesn't even really matter since we are running out of unwise Microsoft extensions to deprecate.

@StephanTLavavej StephanTLavavej removed their assignment Jul 1, 2023
@StephanTLavavej
Copy link
Member

FYI @strega-nil-ms I pushed changes after you approved; probably the most significant being the removal of deprecation on the pointer_traits partial specialization.

@StephanTLavavej StephanTLavavej self-assigned this Jul 13, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 90dcf26 into microsoft:main Jul 14, 2023
@StephanTLavavej
Copy link
Member

Thanks for enhancing and then discouraging use of this old machinery! 🏚️ 🏡 ✨

@kobykahane
Copy link

This deprecation triggered build errors in cpprestsdk: microsoft/cpprestsdk#1768.

briv added a commit to trice-imaging/vcpkg that referenced this pull request Nov 21, 2023
Due to the msvc compiler change in microsoft/STL#3818,
the aws-sdk-cpp CI build breaks (warnings are treated as errors).

A fix is available upstream when we upgrade our vcpkg ports but to avoid
an immediate upgrade, we'll define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
for now.
briv added a commit to trice-imaging/vcpkg that referenced this pull request Nov 21, 2023
Due to the msvc compiler change in microsoft/STL#3818,
the aws-sdk-cpp CI build breaks (warnings are treated as errors).

A fix is available upstream when we upgrade our vcpkg ports but to avoid
an immediate upgrade, we'll define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
for now.
briv added a commit to trice-imaging/vcpkg that referenced this pull request Nov 21, 2023
Due to the msvc compiler change in microsoft/STL#3818,
the aws-sdk-cpp CI build breaks (warnings are treated as errors).

A fix is available upstream when we upgrade our vcpkg ports but to avoid
an immediate upgrade, we'll define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
for now.
briv added a commit to trice-imaging/vcpkg that referenced this pull request Nov 21, 2023
Due to the msvc compiler change in microsoft/STL#3818,
the aws-sdk-cpp CI build breaks (warnings are treated as errors).

A fix is available upstream when we upgrade our vcpkg ports but to avoid
an immediate upgrade, we'll define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

5 participants