From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2003-04-05 00:38:44
> > 2. Could type that implements swap() method somehow follow the second
> > road also? For example, could you somehow deduce T* from buffer and swap
> > 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 point
> which I'm not certain is even true), it's probably not worthwhile. After
> all, sizeof(incomplete<T>) == sizeof(T*), so double-storage means
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 not
use virtual function based solution then? I bet it will be incomparably more
simple to understand and probably easier to use.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk