Skip to content

MSVC is deprecating stdext::checked_array_iterator #3540

Description

@StephanTLavavej

format.h uses MSVC's stdext::checked_array_iterator:

fmt/include/fmt/format.h

Lines 563 to 565 in 661b23e

#if defined(_SECURE_SCL) && _SECURE_SCL
// Make a checked iterator to avoid MSVC warnings.
template <typename T> using checked_ptr = stdext::checked_array_iterator<T*>;

After microsoft/STL#3818 ships in VS 2022 17.8 Preview 2, this will emit deprecation warnings (in C++17 mode and later). We want to discourage use of this non-Standard extension, towards eliminating it in a future version.

MSVC's STL eliminated the incredibly annoying "copying to a raw pointer" warnings many versions ago (it was VS 2017 15.8, I believe), so you should simply be able to drop this usage of stdext::checked_array_iterator and use portable code for all platforms.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions