mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 22:14:26 +02:00
Use value-initialized pointers when null is required, as conversion from literal 0 is not guaranteed in smart pointers.
This commit is contained in:
@@ -380,7 +380,7 @@ struct vector_alloc_holder
|
|||||||
, m_capacity()
|
, m_capacity()
|
||||||
{
|
{
|
||||||
if(initial_size){
|
if(initial_size){
|
||||||
pointer reuse = 0;
|
pointer reuse = pointer();
|
||||||
m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
|
m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ struct vector_alloc_holder
|
|||||||
, m_capacity()
|
, m_capacity()
|
||||||
{
|
{
|
||||||
if(initial_size){
|
if(initial_size){
|
||||||
pointer reuse = 0;
|
pointer reuse = pointer();
|
||||||
m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
|
m_start = this->allocation_command(allocate_new, initial_size, m_capacity = initial_size, reuse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -525,7 +525,7 @@ struct vector_alloc_holder
|
|||||||
void priv_first_allocation(size_type cap)
|
void priv_first_allocation(size_type cap)
|
||||||
{
|
{
|
||||||
if(cap){
|
if(cap){
|
||||||
pointer reuse = 0;
|
pointer reuse = pointer();
|
||||||
m_start = this->allocation_command(allocate_new, cap, cap, reuse);
|
m_start = this->allocation_command(allocate_new, cap, cap, reuse);
|
||||||
m_capacity = cap;
|
m_capacity = cap;
|
||||||
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
|
#ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
|
||||||
|
Reference in New Issue
Block a user