Код: Выделить всё
class example {
private:
int height, width;
std::unique_ptr pointer = nullptr;
public:
example()
:pointer(new uint8_t[height * width * 3]) // this works
{}
};
< /code>
Но я бы скорее инициализировал указатель < /code> элемент встроенного врожденного: < /p>
unique_ptr pointer = new uint8_t[height * width * 3]; // doesnt work
Подробнее здесь: https://stackoverflow.com/questions/576 ... n-one-line
Мобильная версия