diff --git a/include/flatbuffers/stl_emulation.h b/include/flatbuffers/stl_emulation.h index a50a46a7c..97652b170 100644 --- a/include/flatbuffers/stl_emulation.h +++ b/include/flatbuffers/stl_emulation.h @@ -288,13 +288,13 @@ FLATBUFFERS_CONSTEXPR std::size_t dynamic_extent = static_cast(-1); namespace internal { // This is SFINAE helper class for checking of a common condition: // > This overload only participates in overload resolution - // > Check whether a pointer to an array of U can be converted - // > to a pointer to an array of E. - // This helper is used for checking of 'U -> const U'. - template + // > Check whether a pointer to an array of From can be converted + // > to a pointer to an array of To. + // This helper is used for checking of 'From -> const From'. + template struct is_span_convertable { using type = - typename std::conditional::value + typename std::conditional::value && (Extent == dynamic_extent || N == Extent), int, void>::type; }; @@ -467,40 +467,40 @@ class span FLATBUFFERS_FINAL_CLASS { #endif // defined(FLATBUFFERS_USE_STD_SPAN) #if !defined(FLATBUFFERS_SPAN_MINIMAL) -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(U(&arr)[N]) FLATBUFFERS_NOEXCEPT { - return span(arr); +flatbuffers::span make_span(ElementType(&arr)[Extent]) FLATBUFFERS_NOEXCEPT { + return span(arr); } -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(const U(&arr)[N]) FLATBUFFERS_NOEXCEPT { - return span(arr); +flatbuffers::span make_span(const ElementType(&arr)[Extent]) FLATBUFFERS_NOEXCEPT { + return span(arr); } -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(std::array &arr) FLATBUFFERS_NOEXCEPT { - return span(arr); +flatbuffers::span make_span(std::array &arr) FLATBUFFERS_NOEXCEPT { + return span(arr); } -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(const std::array &arr) FLATBUFFERS_NOEXCEPT { - return span(arr); +flatbuffers::span make_span(const std::array &arr) FLATBUFFERS_NOEXCEPT { + return span(arr); } -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { - return span(first, count); +flatbuffers::span make_span(ElementType *first, std::size_t count) FLATBUFFERS_NOEXCEPT { + return span(first, count); } -template +template FLATBUFFERS_CONSTEXPR_CPP11 -flatbuffers::span make_span(const U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { - return span(first, count); +flatbuffers::span make_span(const ElementType *first, std::size_t count) FLATBUFFERS_NOEXCEPT { + return span(first, count); } #endif // !defined(FLATBUFFERS_SPAN_MINIMAL)