Skip to content

<iterator>: Consider deprecating and removing stdext::checked_array_iterator/unchecked_array_iterator #951

@StephanTLavavej

Description

@StephanTLavavej

We've been shipping the non-Standard extensions stdext::checked_array_iterator and stdext::unchecked_array_iterator for a long time (I believe since VS 2005):

STL/stl/inc/iterator

Lines 521 to 523 in 5ef22f2

template <class _Ptr>
class checked_array_iterator { // wrap a pointer with checking
static_assert(_STD is_pointer_v<_Ptr>, "checked_array_iterator requires pointers");

STL/stl/inc/iterator

Lines 718 to 720 in 5ef22f2

template <class _Ptr>
class unchecked_array_iterator { // wrap a pointer without checking, to silence warnings
static_assert(_STD is_pointer_v<_Ptr>, "unchecked_array_iterator requires pointers");

As non-Standard extensions, they're rarely used. They haven't been updated to behave like modern iterators (see #943) and they supported a design that we've ripped out (where the STL algorithms used to emit warnings when raw pointers were used as output iterators; this has been superseded by static analysis). Finally, they have been essentially superseded by better types: std::span (which provides debug checks and release performance) and gsl::span (which provides unconditional security checks).

I believe that we should consider marking these stdext iterators as deprecated in VS 2019, and remove them entirely in vNext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions