1) This line is not valid at all. I think you meant _buffer = _size > 0 ? new T[_size] : nullptr;
2) Even in this case it is still not valid: you cannot assign pointer to smart pointer, you need to expicitely reset pointer: _buffer.reset(_size > 0 ? newint[_size] : nullptr);