CPPPROGLIB Telegram 5007
😱 Можно ли использовать std::make_unique и std::make_shared для инициализации массива?

Ответ: Да.

1 . std::make_unique:

Начиная с C++14 можно создавать через make_unique
auto arr = std::make_unique<int[]>(5);

2 . std::make_shared:

В стандарте C++20 появилась возможность создавать и make_shared

auto arr = std::make_shared<int[]>(5);



tgoop.com/cppproglib/5007
Create:
Last Update:

😱 Можно ли использовать std::make_unique и std::make_shared для инициализации массива?

Ответ: Да.

1 . std::make_unique:

Начиная с C++14 можно создавать через make_unique
auto arr = std::make_unique<int[]>(5);

2 . std::make_shared:

В стандарте C++20 появилась возможность создавать и make_shared

auto arr = std::make_shared<int[]>(5);

BY Библиотека C/C++ разработчика | cpp, boost, qt


Share with your friend now:
tgoop.com/cppproglib/5007

View MORE
Open in Telegram


Telegram News

Date: |

How to build a private or public channel on Telegram? With the administration mulling over limiting access to doxxing groups, a prominent Telegram doxxing group apparently went on a "revenge spree." According to media reports, the privacy watchdog was considering “blacklisting” some online platforms that have repeatedly posted doxxing information, with sources saying most messages were shared on Telegram. Telegram offers a powerful toolset that allows businesses to create and manage channels, groups, and bots to broadcast messages, engage in conversations, and offer reliable customer support via bots. Matt Hussey, editorial director at NEAR Protocol also responded to this news with “#meIRL”. Just as you search “Bear Market Screaming” in Telegram, you will see a Pepe frog yelling as the group’s featured image.
from us


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM American