Modernes C++ programmieren

Okt 23, 2024

lst-0463-book.cpp

// https://godbolt.org/z/9eeG575Wz 
struct Puffer {
  const char *data;
  explicit Puffer(unsigned sz): data(new char[sz]) {}
  ~Puffer() { delete[] data; }
  Puffer(const Puffer&) = delete;
  Puffer& operator=(const Puffer&) = delete;
};