In this code, when will (should) Xfromer::releas e be called?
struct C {
C(const char* c) { f = Xformer::xform( c); }
~C() { Xformer::releas e(f); }
const F* get() const { return f; }
F* f;
};
void fun(const char* c) {
F* foo = C(c).get();
bar(foo);
baz();
}
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
struct C {
C(const char* c) { f = Xformer::xform( c); }
~C() { Xformer::releas e(f); }
const F* get() const { return f; }
F* f;
};
void fun(const char* c) {
F* foo = C(c).get();
bar(foo);
baz();
}
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Comment