lst-0464-book.cpp
// https://godbolt.org/z/TK3vTv1EM
struct StereoImage {
Image *left, *right;
StereoImage()
: left(new Image)
, right(new Image) // Gefahr!
{ }
~StereoImage() {
delete left;
delete right;
}
};
// https://godbolt.org/z/TK3vTv1EM
struct StereoImage {
Image *left, *right;
StereoImage()
: left(new Image)
, right(new Image) // Gefahr!
{ }
~StereoImage() {
delete left;
delete right;
}
};