Skip to content

Commit 16280f6

Browse files
committed
Mark assign as deprecated
1 parent 16b6ba8 commit 16280f6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

include/boost/array.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,16 @@ namespace boost {
163163
return *this;
164164
}
165165

166-
// assign one value to all elements
167-
void assign (const T& value) { fill ( value ); } // A synonym for fill
166+
// fill with one value
168167
BOOST_CXX14_CONSTEXPR void fill (const T& value)
169168
{
170169
std::fill_n(begin(),size(),value);
171170
}
172171

172+
// an obsolete synonym for fill
173+
BOOST_DEPRECATED( "please use `fill` instead" )
174+
void assign (const T& value) { fill ( value ); }
175+
173176
// check range (may be private because it is static)
174177
static BOOST_CONSTEXPR bool rangecheck (size_type i) {
175178
return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true;
@@ -278,8 +281,11 @@ namespace boost {
278281
return *this;
279282
}
280283

281-
// assign one value to all elements
284+
// an obsolete synonym for fill
285+
BOOST_DEPRECATED( "please use `fill` instead" )
282286
void assign (const T& value) { fill ( value ); }
287+
288+
// fill with one value
283289
BOOST_CXX14_CONSTEXPR void fill (const T& ) {}
284290

285291
// check range (may be private because it is static)

0 commit comments

Comments
 (0)