Please don’t pass around a std::shared_ptr<T>
when you don’t need to.
struct MyStruct {
int *ptr;
MyStruct() : ptr(new int) {}
~MyStruct() {
delete ptr;
}
};
Please don’t pass around a std::shared_ptr<T>
when you don’t need to.
struct MyStruct {
int *ptr;
MyStruct() : ptr(new int) {}
~MyStruct() {
delete ptr;
}
};