From eccc924f47546a0a9149e87ce7aaa6241062c8dc Mon Sep 17 00:00:00 2001 From: Shawn Zhong Date: Sat, 29 Apr 2023 05:40:29 -0500 Subject: [PATCH] Fix compile error --- include/fmt/core.h | 14 ++++++++++++++ include/fmt/format.h | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 43efa115..f4db0dd7 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -859,6 +859,20 @@ FMT_CONSTEXPR auto copy_str(T* begin, T* end, U* out) -> U* { return out + size; } +#if defined(_SECURE_SCL) && _SECURE_SCL +// Make a checked iterator to avoid MSVC warnings. +template using checked_ptr = stdext::checked_array_iterator; +template +constexpr auto make_checked(T* p, size_t size) -> checked_ptr { + return {p, size}; +} +#else +template using checked_ptr = T*; +template constexpr auto make_checked(T* p, size_t) -> T* { + return p; +} +#endif + /** \rst A contiguous memory buffer with an optional growing ability. It is an internal diff --git a/include/fmt/format.h b/include/fmt/format.h index 8a5f36a4..0d8701e3 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -555,20 +555,6 @@ inline FMT_CONSTEXPR auto get_data(Container& c) -> return c.data(); } -#if defined(_SECURE_SCL) && _SECURE_SCL -// Make a checked iterator to avoid MSVC warnings. -template using checked_ptr = stdext::checked_array_iterator; -template -constexpr auto make_checked(T* p, size_t size) -> checked_ptr { - return {p, size}; -} -#else -template using checked_ptr = T*; -template constexpr auto make_checked(T* p, size_t) -> T* { - return p; -} -#endif - // Attempts to reserve space for n extra characters in the output range. // Returns a pointer to the reserved range or a reference to it. template ::value)>