/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/cpp/cpp-506-1-001/main.cpp
16 строк
345 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
#include <iostream> #include <string> #include <memory> class Greeting { std::string message; public: explicit Greeting(std::string msg) : message(std::move(msg)) {} void print() const { std::cout << message << '\n'; } }; int main() { auto hello = std::make_unique<Greeting>("Hello, C++!"); hello->print(); return 0; }