Skip to content

Commit

Permalink
Mark assign as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 26, 2025
1 parent 16b6ba8 commit 16280f6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions include/boost/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 16280f6

Please sign in to comment.