R
rwf_20
In standard C++, it is recommended to avoid unmanaged resource
acquisition in initialization lists, such as:
class C {
public:
C(const int i) : m_i(new int(i)) { }
private:
int m_i;
};
I'm assuming this holds for code built via /clr as well. But, do the
'Smart' features of .NET ref types ('^') make this acceptable with
managed types? E.g.
ref class C {
public:
C() : m_obj(gcnew ManagedObject) { }
private:
ManagedObject^ m_obj;
};
Is this safe in VC 8?
Ryan
acquisition in initialization lists, such as:
class C {
public:
C(const int i) : m_i(new int(i)) { }
private:
int m_i;
};
I'm assuming this holds for code built via /clr as well. But, do the
'Smart' features of .NET ref types ('^') make this acceptable with
managed types? E.g.
ref class C {
public:
C() : m_obj(gcnew ManagedObject) { }
private:
ManagedObject^ m_obj;
};
Is this safe in VC 8?
Ryan