[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (OT) Re: memory management



Pierre Phaneuf wrote:

 
> Personally, here's my base object:
> 
> class Object {
> public:
>   virtual ~Object {};
> };
> 
> Is that lightweight enough for you? Does two things: enables general
> containers by having a type compatible with all the other ones and makes
> destructor works correctly (damn C++, why isn't "virtual" the friggin'
> DEFAULT???).


But then in C++ you run into the problem of always having to remember the
possibility of multiple inheritances.  End up having to throw "virtual
public Object" all over your code.


Nicholas