From 1daeb0b4880c5184a012e2174ca55ea4bdc0fc1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 26 Apr 2026 00:40:59 +0200 Subject: [PATCH] Make segduo convertible from another segduo and activate the dual random-access optimization. --- .../experimental/segmented_iterator_traits.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/boost/container/experimental/segmented_iterator_traits.hpp b/include/boost/container/experimental/segmented_iterator_traits.hpp index 1696af9..7db0f21 100644 --- a/include/boost/container/experimental/segmented_iterator_traits.hpp +++ b/include/boost/container/experimental/segmented_iterator_traits.hpp @@ -48,7 +48,12 @@ struct segduo T2 second; BOOST_CONTAINER_FORCEINLINE segduo() {} - BOOST_CONTAINER_FORCEINLINE segduo(const T1 &f, const T2 &s) : first(f), second(s) {} + + template + BOOST_CONTAINER_FORCEINLINE segduo(const U1 &f, const U2 &s) : first(f), second(s) {} + + template + BOOST_CONTAINER_FORCEINLINE segduo(const segduo &sd) : first(sd.first), second(sd.second) {} }; struct unreachable_sentinel_t @@ -297,4 +302,10 @@ struct deepest_local_iterator //#define BOOST_CONTAINER_DISABLE_MULTI_SEGMENTED_ALGO +//#define BOOST_CONTAINER_SEGMENTED_DISABLE_DUAL_RA_OPTIMIZATION + +#if !defined(BOOST_CONTAINER_SEGMENTED_DISABLE_DUAL_RA_OPTIMIZATION) +#define BOOST_CONTAINER_SEGMENTED_ENABLE_DUAL_RA_OPTIMIZATION +#endif + #endif // BOOST_CONTAINER_EXPERIMENTAL_SEGMENTED_ITERATOR_TRAITS_HPP