From: Eric Friedman (ebf_at_[hidden])
Date: 2003-04-05 22:32:38
Gennadiy Rozental wrote:
> > > 2. Could type that implements swap() method somehow follow the second
> > > road also? For example, could you somehow deduce T* from buffer and
> > it
> > > with local copy of the argument?
> > Yes, I can look into such optimizations. But as I noted in previous
> > messages, if I can prevent double-storage only for incomplete<T> (a
> > which I'm not certain is even true), it's probably not worthwhile. After
> > all, sizeof(incomplete<T>) == sizeof(T*), so double-storage means
> > 2*sizeof(T*).
> So the tradeoff here is extra 4 bytes for the object size plus double
> indirection for all access operations. Here the question arise then why
> use virtual function based solution then? I bet it will be incomparably
> simple to understand and probably easier to use.
I'm not quite sure how virtual functions will solve anything, but I am eager
to understand if indeed they will.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk