CPP_GEEK Telegram 190
Бывает такое, что оператор new не выделяет память?

Ответ:
Да, бывает, когда new передаётся указатель на уже выделенную память (например, с помощью malloc). Это называется placement new. И оператор new без изменения возвращает второй параметр - указатель (void* operator new(std::size_t, void*)). Это используется для создания объектов в выделенном "хранилище" или после malloc.

Важно! В этом случае деструктор нужно вызывать самостоятельно!

➡️ @cpp_geek
👍81



tgoop.com/cpp_geek/190
Create:
Last Update:

Бывает такое, что оператор new не выделяет память?

Ответ:
Да, бывает, когда new передаётся указатель на уже выделенную память (например, с помощью malloc). Это называется placement new. И оператор new без изменения возвращает второй параметр - указатель (void* operator new(std::size_t, void*)). Это используется для создания объектов в выделенном "хранилище" или после malloc.

Важно! В этом случае деструктор нужно вызывать самостоятельно!

➡️ @cpp_geek

BY C++ geek




Share with your friend now:
tgoop.com/cpp_geek/190

View MORE
Open in Telegram


Telegram News

Date: |

So far, more than a dozen different members have contributed to the group, posting voice notes of themselves screaming, yelling, groaning, and wailing in various pitches and rhythms. Joined by Telegram's representative in Brazil, Alan Campos, Perekopsky noted the platform was unable to cater to some of the TSE requests due to the company's operational setup. But Perekopsky added that these requests could be studied for future implementation. fire bomb molotov November 18 Dylan Hollingsworth yau ma tei Just as the Bitcoin turmoil continues, crypto traders have taken to Telegram to voice their feelings. Crypto investors can reduce their anxiety about losses by joining the “Bear Market Screaming Therapy Group” on Telegram. Concise
from us


Telegram C++ geek
FROM American