25 Aralık 2017 Pazartesi

std::get_temporary_buffer

Giriş
İmzası şöyle.
template< class T >
std::pair< T*, std::ptrdiff_t > get_temporary_buffer( std::ptrdiff_t count );
Bu çağrı C++17 ile deprecate ediliyor. Açıklaması şöyle.
This API would be considered an incomplete thought were it proposed today. As a functional API it lacks exception safety if the function allocating the buffer leaks, yet we offer no RAII-like wrappers to promote safe use.
It has been suggested that all current implementation of this API actually do not perform a more efficient allocation than the regular new operator, and, if that is genuinely the case, we should seriously consider deprecating this facility. Otherwise, we should probably complete the design with an appropriate guard/wrapper class, and encourage vendors to deliver on missed optimization opportunities.
Yerine düz new/delete kullanılması öneriliyor.

Hiç yorum yok:

Yorum Gönder