From 16280f660ba79b1632067885144e40bedd4dfac5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 26 Jan 2025 03:06:28 +0200 Subject: [PATCH] Mark `assign` as deprecated --- include/boost/array.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/boost/array.hpp b/include/boost/array.hpp index 2e3588dd..19cd5061 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -163,13 +163,16 @@ namespace boost { return *this; } - // assign one value to all elements - void assign (const T& value) { fill ( value ); } // A synonym for fill + // fill with one value BOOST_CXX14_CONSTEXPR void fill (const T& value) { std::fill_n(begin(),size(),value); } + // an obsolete synonym for fill + BOOST_DEPRECATED( "please use `fill` instead" ) + void assign (const T& value) { fill ( value ); } + // check range (may be private because it is static) static BOOST_CONSTEXPR bool rangecheck (size_type i) { return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true; @@ -278,8 +281,11 @@ namespace boost { return *this; } - // assign one value to all elements + // an obsolete synonym for fill + BOOST_DEPRECATED( "please use `fill` instead" ) void assign (const T& value) { fill ( value ); } + + // fill with one value BOOST_CXX14_CONSTEXPR void fill (const T& ) {} // check range (may be private because it is static)