@@ -150,11 +150,13 @@ class adaptive_pool
150150
151151 // !Returns the number of elements that could be allocated.
152152 // !Never throws
153+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
153154 size_type max_size () const BOOST_NOEXCEPT_OR_NOTHROW
154155 { return size_type (-1 )/(2u *sizeof (T)); }
155156
156157 // !Allocate memory for an array of count elements.
157158 // !Throws bad_alloc if there is no enough memory
159+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
158160 pointer allocate (size_type count, const void * = 0 )
159161 {
160162 if (BOOST_UNLIKELY (count > size_type (-1 )/(2u *sizeof (T))))
@@ -187,6 +189,7 @@ class adaptive_pool
187189 }
188190 }
189191
192+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
190193 pointer allocation_command (allocation_type command,
191194 size_type limit_size,
192195 size_type &prefer_in_recvd_out_size,
@@ -206,6 +209,7 @@ class adaptive_pool
206209 // !Allocates just one object. Memory allocated with this function
207210 // !must be deallocated only with deallocate_one().
208211 // !Throws bad_alloc if there is no enough memory
212+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
209213 pointer allocate_one ()
210214 {
211215 typedef dtl::shared_adaptive_node_pool
@@ -317,11 +321,13 @@ class adaptive_pool
317321
318322 // !An allocator always compares to true, as memory allocated with one
319323 // !instance can be deallocated by another instance
324+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
320325 friend bool operator ==(const adaptive_pool &, const adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
321326 { return true ; }
322327
323328 // !An allocator always compares to false, as memory allocated with one
324329 // !instance can be deallocated by another instance
330+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
325331 friend bool operator !=(const adaptive_pool &, const adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
326332 { return false ; }
327333
@@ -466,11 +472,13 @@ class private_adaptive_pool
466472
467473 // !Returns the number of elements that could be allocated.
468474 // !Never throws
475+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
469476 size_type max_size () const BOOST_NOEXCEPT_OR_NOTHROW
470477 { return size_type (-1 )/(2u *sizeof (T)); }
471478
472479 // !Allocate memory for an array of count elements.
473480 // !Throws bad_alloc if there is no enough memory
481+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
474482 pointer allocate (size_type count, const void * = 0 )
475483 {
476484 if (BOOST_UNLIKELY (count > size_type (-1 )/(2u *sizeof (T))))
@@ -497,6 +505,7 @@ class private_adaptive_pool
497505 }
498506 }
499507
508+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
500509 pointer allocation_command (allocation_type command,
501510 size_type limit_size,
502511 size_type &prefer_in_recvd_out_size,
@@ -516,6 +525,7 @@ class private_adaptive_pool
516525 // !Allocates just one object. Memory allocated with this function
517526 // !must be deallocated only with deallocate_one().
518527 // !Throws bad_alloc if there is no enough memory
528+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
519529 pointer allocate_one ()
520530 {
521531 return (pointer)m_pool.allocate_node ();
@@ -583,11 +593,13 @@ class private_adaptive_pool
583593
584594 // !An allocator always compares to true, as memory allocated with one
585595 // !instance can be deallocated by another instance
596+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
586597 friend bool operator ==(const private_adaptive_pool &, const private_adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
587598 { return true ; }
588599
589600 // !An allocator always compares to false, as memory allocated with one
590601 // !instance can be deallocated by another instance
602+ BOOST_CONTAINER_ATTRIBUTE_NODISCARD
591603 friend bool operator !=(const private_adaptive_pool &, const private_adaptive_pool &) BOOST_NOEXCEPT_OR_NOTHROW
592604 { return false ; }
593605
0 commit comments