Skip to content

Commit 7a22ae2

Browse files
committed
Replace BOOST_CONTAINER_ATTRIBUTE_NODISCARD with BOOST_CONTAINER_NODISCARD
1 parent ac523b2 commit 7a22ae2

23 files changed

+592
-592
lines changed

doc/Jamfile.v2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ doxygen autodoc
4444
\"BOOST_RV_REF_END_IF_CXX11=&&\" \\
4545
\"BOOST_COPY_ASSIGN_REF(T)=const T &\" \\
4646
\"BOOST_FWD_REF(a)=a &&\" \\
47-
\"BOOST_CONTAINER_ATTRIBUTE_NODISCARD=[[nodiscard]] \" \\
47+
\"BOOST_CONTAINER_NODISCARD=[[nodiscard]] \" \\
4848
\"BOOST_NORETURN=[[noreturn]] \" \\
4949
\"BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME) = template<TYPE VALUE> struct OPTION_NAME{};\" \\
5050
\"BOOST_INTRUSIVE_OPTION_TYPE(OPTION_NAME, TYPE, TYPEDEF_EXPR, TYPEDEF_NAME) = template<class TYPE> struct OPTION_NAME{};\" \\

include/boost/container/adaptive_pool.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ class adaptive_pool
150150

151151
//!Returns the number of elements that could be allocated.
152152
//!Never throws
153-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
153+
BOOST_CONTAINER_NODISCARD
154154
size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
155155
{ return size_type(-1)/(2u*sizeof(T)); }
156156

157157
//!Allocate memory for an array of count elements.
158158
//!Throws bad_alloc if there is no enough memory
159-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
159+
BOOST_CONTAINER_NODISCARD
160160
pointer allocate(size_type count, const void * = 0)
161161
{
162162
if(BOOST_UNLIKELY(count > size_type(-1)/(2u*sizeof(T))))
@@ -189,7 +189,7 @@ class adaptive_pool
189189
}
190190
}
191191

192-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
192+
BOOST_CONTAINER_NODISCARD
193193
pointer allocation_command(allocation_type command,
194194
size_type limit_size,
195195
size_type &prefer_in_recvd_out_size,
@@ -209,7 +209,7 @@ class adaptive_pool
209209
//!Allocates just one object. Memory allocated with this function
210210
//!must be deallocated only with deallocate_one().
211211
//!Throws bad_alloc if there is no enough memory
212-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
212+
BOOST_CONTAINER_NODISCARD
213213
pointer allocate_one()
214214
{
215215
typedef dtl::shared_adaptive_node_pool
@@ -321,13 +321,13 @@ class adaptive_pool
321321

322322
//!An allocator always compares to true, as memory allocated with one
323323
//!instance can be deallocated by another instance
324-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
324+
BOOST_CONTAINER_NODISCARD
325325
friend bool operator==(const adaptive_pool &, const adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
326326
{ return true; }
327327

328328
//!An allocator always compares to false, as memory allocated with one
329329
//!instance can be deallocated by another instance
330-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
330+
BOOST_CONTAINER_NODISCARD
331331
friend bool operator!=(const adaptive_pool &, const adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
332332
{ return false; }
333333

@@ -472,13 +472,13 @@ class private_adaptive_pool
472472

473473
//!Returns the number of elements that could be allocated.
474474
//!Never throws
475-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
475+
BOOST_CONTAINER_NODISCARD
476476
size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
477477
{ return size_type(-1)/(2u*sizeof(T)); }
478478

479479
//!Allocate memory for an array of count elements.
480480
//!Throws bad_alloc if there is no enough memory
481-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
481+
BOOST_CONTAINER_NODISCARD
482482
pointer allocate(size_type count, const void * = 0)
483483
{
484484
if(BOOST_UNLIKELY(count > size_type(-1)/(2u*sizeof(T))))
@@ -505,7 +505,7 @@ class private_adaptive_pool
505505
}
506506
}
507507

508-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
508+
BOOST_CONTAINER_NODISCARD
509509
pointer allocation_command(allocation_type command,
510510
size_type limit_size,
511511
size_type &prefer_in_recvd_out_size,
@@ -525,7 +525,7 @@ class private_adaptive_pool
525525
//!Allocates just one object. Memory allocated with this function
526526
//!must be deallocated only with deallocate_one().
527527
//!Throws bad_alloc if there is no enough memory
528-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
528+
BOOST_CONTAINER_NODISCARD
529529
pointer allocate_one()
530530
{
531531
return (pointer)m_pool.allocate_node();
@@ -593,13 +593,13 @@ class private_adaptive_pool
593593

594594
//!An allocator always compares to true, as memory allocated with one
595595
//!instance can be deallocated by another instance
596-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
596+
BOOST_CONTAINER_NODISCARD
597597
friend bool operator==(const private_adaptive_pool &, const private_adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
598598
{ return true; }
599599

600600
//!An allocator always compares to false, as memory allocated with one
601601
//!instance can be deallocated by another instance
602-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
602+
BOOST_CONTAINER_NODISCARD
603603
friend bool operator!=(const private_adaptive_pool &, const private_adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
604604
{ return false; }
605605

include/boost/container/allocator.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class allocator
179179
//!Throws bad_alloc if there is no enough memory
180180
//!If Version is 2, this allocated memory can only be deallocated
181181
//!with deallocate() or (for Version == 2) deallocate_many()
182-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD pointer allocate(size_type count, const void * hint= 0)
182+
BOOST_CONTAINER_NODISCARD pointer allocate(size_type count, const void * hint= 0)
183183
{
184184
(void)hint;
185185
if(count > size_type(-1)/(2u*sizeof(T)))
@@ -197,7 +197,7 @@ class allocator
197197

198198
//!Returns the maximum number of elements that could be allocated.
199199
//!Never throws
200-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
200+
BOOST_CONTAINER_NODISCARD inline size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
201201
{ return size_type(-1)/(2u*sizeof(T)); }
202202

203203
//!Swaps two allocators, does nothing
@@ -207,21 +207,21 @@ class allocator
207207

208208
//!An allocator always compares to true, as memory allocated with one
209209
//!instance can be deallocated by another instance
210-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
210+
BOOST_CONTAINER_NODISCARD
211211
friend bool operator==(const allocator &, const allocator &) BOOST_NOEXCEPT_OR_NOTHROW
212212
{ return true; }
213213

214214
//!An allocator always compares to false, as memory allocated with one
215215
//!instance can be deallocated by another instance
216-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
216+
BOOST_CONTAINER_NODISCARD inline
217217
friend bool operator!=(const allocator &, const allocator &) BOOST_NOEXCEPT_OR_NOTHROW
218218
{ return false; }
219219

220220
//!An advanced function that offers in-place expansion shrink to fit and new allocation
221221
//!capabilities. Memory allocated with this function can only be deallocated with deallocate()
222222
//!or deallocate_many().
223223
//!This function is available only with Version == 2
224-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD pointer allocation_command(allocation_type command,
224+
BOOST_CONTAINER_NODISCARD pointer allocation_command(allocation_type command,
225225
size_type limit_size,
226226
size_type &prefer_in_recvd_out_size,
227227
pointer &reuse)
@@ -240,7 +240,7 @@ class allocator
240240
//!Memory must not have been allocated with
241241
//!allocate_one or allocate_individual.
242242
//!This function is available only with Version == 2
243-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD size_type size(pointer p) const BOOST_NOEXCEPT_OR_NOTHROW
243+
BOOST_CONTAINER_NODISCARD size_type size(pointer p) const BOOST_NOEXCEPT_OR_NOTHROW
244244
{
245245
BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 ));
246246
return dlmalloc_size(p);
@@ -250,7 +250,7 @@ class allocator
250250
//!must be deallocated only with deallocate_one().
251251
//!Throws bad_alloc if there is no enough memory
252252
//!This function is available only with Version == 2
253-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline pointer allocate_one()
253+
BOOST_CONTAINER_NODISCARD inline pointer allocate_one()
254254
{
255255
BOOST_CONTAINER_STATIC_ASSERT(( Version > 1 ));
256256
return this->allocate(1);

include/boost/container/allocator_traits.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ struct allocator_traits
423423

424424
//! <b>Returns</b>: <code>a.allocate(n)</code>
425425
//!
426-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
426+
BOOST_CONTAINER_NODISCARD
427427
inline static pointer allocate(Allocator &a, size_type n)
428428
{ return a.allocate(n); }
429429

@@ -435,7 +435,7 @@ struct allocator_traits
435435

436436
//! <b>Effects</b>: calls <code>a.allocate(n, p)</code> if that call is well-formed;
437437
//! otherwise, invokes <code>a.allocate(n)</code>
438-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
438+
BOOST_CONTAINER_NODISCARD
439439
inline static pointer allocate(Allocator &a, size_type n, const_void_pointer p)
440440
{
441441
const bool value = boost::container::dtl::
@@ -460,7 +460,7 @@ struct allocator_traits
460460

461461
//! <b>Returns</b>: <code>a.max_size()</code> if that expression is well-formed; otherwise,
462462
//! <code>numeric_limits<size_type>::max()</code>.
463-
BOOST_CONTAINER_ATTRIBUTE_NODISCARD
463+
BOOST_CONTAINER_NODISCARD
464464
inline static size_type max_size(const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
465465
{
466466
const bool value = allocator_traits_detail::has_max_size<Allocator, size_type (Allocator::*)() const>::value;

0 commit comments

Comments
 (0)