Как создать новый объект unique_ptr и присвоить ему значение в конструкторе класса?
Мои усилия:
#include
#include
class A {
public:
A() {};
A(int);
void print();
private:
std::unique_ptr int_ptr_;
};
A::A(int a) {
int_ptr_ = new int(a);
}
void A::print() {
std::cout
Подробнее здесь: https://stackoverflow.com/questions/415 ... s-construc