From 05b3025c0e599ea33a2578483b29b005cae277bb Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 12 Oct 2022 08:58:32 -0700 Subject: [PATCH] Fix regression in how the table_iterator defines its reference type --- include/boost/unordered/detail/foa.hpp | 3 ++- test/unordered/compile_set.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index dcb6a749..dfa99753 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -621,7 +621,8 @@ public: using value_type=Value; using pointer= typename std::conditional::type; - using reference=value_type&; + using reference= + typename std::conditional::type; using iterator_category=std::forward_iterator_tag; using element_type= typename std::conditional::type; diff --git a/test/unordered/compile_set.cpp b/test/unordered/compile_set.cpp index 32e4a170..dfd40d53 100644 --- a/test/unordered/compile_set.cpp +++ b/test/unordered/compile_set.cpp @@ -64,6 +64,19 @@ INSTANTIATE(multiset) set_type; +#else + typedef boost::unordered_set set_type; +#endif + + typedef set_type::iterator iterator; + + BOOST_STATIC_ASSERT(boost::is_same::reference>::value); +} + UNORDERED_AUTO_TEST (test0) { test::minimal::constructor_param x;