forked from boostorg/container
Fix max_size to return the size_type(-1)/sizeof(value_type), as otherwise it would overflow on allocation.
This commit is contained in:
1 parent
7635eba375
commit
1012987897
2 files changed
+2
-2
No files matched your search
@@ -339,7 +339,7 @@ struct allocator_traits
|
||||
{ return a.max_size(); }
|
||||
|
||||
static size_type priv_max_size(container_detail::false_type, const Allocator &) BOOST_CONTAINER_NOEXCEPT
|
||||
{ return size_type(-1); }
|
||||
{ return size_type(-1)/sizeof(value_type); }
|
||||
|
||||
static Allocator priv_select_on_container_copy_construction(container_detail::true_type, const Allocator &a)
|
||||
{ return a.select_on_container_copy_construction(); }
|
||||
|
||||
Reference in new issue
Block a user