From a9f234228c1fff54fbc4852dab167ede899944d3 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Wed, 22 Feb 2023 19:42:12 +0000 Subject: [PATCH] Explicitly default copy assignment operator The compiler-generated copy assignment operator is deprecated since C++11 on classes with user-declared copy constructor. This change allows clean compilation with the -Wdeprecated-copy/-Wdeprecated-copy-with-user-provided-ctor flag. --- include/boost/range/sub_range.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/range/sub_range.hpp b/include/boost/range/sub_range.hpp index d1c3b99b0..02c5d45cf 100644 --- a/include/boost/range/sub_range.hpp +++ b/include/boost/range/sub_range.hpp @@ -185,6 +185,8 @@ class sub_range_base : base(impl::adl_begin(const_cast(static_cast(r))), impl::adl_end(const_cast(static_cast(r)))) { } +#elif !(defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)) + sub_range(const sub_range& r) = default; #endif template< class ForwardRange2 >