From c7b7aacdcd74278516cabd99b7870e5345d5970f Mon Sep 17 00:00:00 2001 From: yaito3014 Date: Thu, 18 Jul 2024 17:15:11 +0900 Subject: [PATCH 1/2] fix Indexed --- Siv3D/include/Siv3D/detail/Indexed.ipp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Siv3D/include/Siv3D/detail/Indexed.ipp b/Siv3D/include/Siv3D/detail/Indexed.ipp index ae1110013..c07479d80 100644 --- a/Siv3D/include/Siv3D/detail/Indexed.ipp +++ b/Siv3D/include/Siv3D/detail/Indexed.ipp @@ -20,11 +20,13 @@ namespace s3d struct Iterator { + using value_type = std::tuple::value_type>; + using reference = std::tuple())>; size_t index; It it; constexpr bool operator != (const Iterator& other) const { return it != other.it; } constexpr void operator ++() { ++index; ++it; } - constexpr auto operator *() const { return std::tie(index, *it); } + constexpr auto operator *() const { return reference{ index, *it }; } }; struct IterableWrapper @@ -48,11 +50,13 @@ namespace s3d { struct Iterator { + using value_type = std::tuple::value_type>; + using reference = std::tuple())>; size_t index; It it; constexpr bool operator != (const Iterator& other) const { return it != other.it; } constexpr void operator ++() { --index; ++it; } - constexpr auto operator *() const { return std::tie(index, *it); } + constexpr auto operator *() const { return reference{ index, *it }; } }; struct IterableWrapper From eacf200b0a331e3b74a584bac686a5f32211de27 Mon Sep 17 00:00:00 2001 From: yaito3104 Date: Mon, 29 Jul 2024 04:12:04 +0000 Subject: [PATCH 2/2] remove unused typedef --- Siv3D/include/Siv3D/detail/Indexed.ipp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Siv3D/include/Siv3D/detail/Indexed.ipp b/Siv3D/include/Siv3D/detail/Indexed.ipp index c07479d80..58178f5ef 100644 --- a/Siv3D/include/Siv3D/detail/Indexed.ipp +++ b/Siv3D/include/Siv3D/detail/Indexed.ipp @@ -20,7 +20,6 @@ namespace s3d struct Iterator { - using value_type = std::tuple::value_type>; using reference = std::tuple())>; size_t index; It it; @@ -50,7 +49,6 @@ namespace s3d { struct Iterator { - using value_type = std::tuple::value_type>; using reference = std::tuple())>; size_t index; It it;