| 471 | |
| 472 | template<class GrowthFactorType> |
| 473 | size_type next_capacity(size_type additional_objects) const |
| 474 | { |
| 475 | BOOST_ASSERT(additional_objects > size_type(this->m_capacity - this->m_size)); |
| 476 | size_type max = allocator_traits_type::max_size(this->alloc()); |
| 477 | (clamp_by_stored_size_type<size_type>)(max, stored_size_type()); |
| 478 | const size_type remaining_cap = size_type(max - size_type(this->m_capacity)); |
| 479 | const size_type min_additional_cap = size_type(additional_objects - size_type(this->m_capacity - this->m_size)); |
| 480 | |
| 481 | if ( remaining_cap < min_additional_cap ) |
| 482 | boost::container::throw_length_error("get_next_capacity, allocator's max size reached"); |
| 483 | |
| 484 | return GrowthFactorType()( size_type(this->m_capacity), min_additional_cap, max); |
| 485 | } |
| 486 | |
| 487 | pointer m_start; |
| 488 | stored_size_type m_size; |
nothing calls this directly
no test coverage detected