From 7adef4f42555ce8e5e63b29acab03d1170cfdab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 24 Jan 2026 17:11:34 +0100 Subject: [PATCH] Use SFINAE to avoid calling iterator-range functions when trying to call size + value constructors --- include/boost/container/string.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index d8707ca..1f9c796 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -885,7 +885,10 @@ class basic_string //! Effects: Constructs a basic_string with a default-constructed allocator, //! and a range of iterators. template - basic_string(InputIterator f, InputIterator l) + basic_string(InputIterator f, InputIterator l + BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c + < dtl::is_convertible::value + BOOST_MOVE_I dtl::nat >::type * = 0)) : base_t() { this->priv_terminate_string(); @@ -895,7 +898,10 @@ class basic_string //! Effects: Constructs a basic_string taking the allocator as parameter, //! and a range of iterators. template - basic_string(InputIterator f, InputIterator l, const allocator_type& a) + basic_string(InputIterator f, InputIterator l, const allocator_type& a + BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I typename dtl::disable_if_c + < dtl::is_convertible::value + BOOST_MOVE_I dtl::nat >::type * = 0)) : base_t(a) { this->priv_terminate_string();