⚖ Compare news

Put up to three stories side by side. Pick IDs from any article URL: /compare?id=123&id=456

Управление памятью в контейнерах STL. От абстракций к реализации

habrahabr.ru ·Russian Federation · health
Words
47
Chars
273
AI summary
Yes
Full story

Memory management in STL containers is framed as a move from abstraction to implementation. For C++ developers, the starting point is operator new, usually explained as allocating heap memory and creating an object there. A typical line such as auto ptr = new MyClass(42); is often used without thinking about what actually happens behind it.

Каждый разработчик на C++ начинает свой путь с оператора new. Нам объясняют его работу очень просто: « new выделяет память в куче и создает там объект». Мы пишем auto ptr = new MyClass(42); и до поры до времени не задумываемся, что скрывается за этой строчкой. Читать далее

Open article