std::allocator should use sized delete

Victor via libstdc++ libstdc++@gcc.gnu.org
Fri Jun 7 06:37:00 GMT 2019


Hi!

C++14 introduced function ::operator delete(void * , 
size_t ) but libstdc++ std::allocator::deallocate() still 
uses the unsized version. Shouldn't it look like

void deallocate(pointer __p, size_type __n)
{
     ::operator delete(__p
#if __cpp_sized_deallocation
         , __n * sizeof(_Tp)
#endif
     );
}

?



More information about the Libstdc++ mailing list