> > 2. Could type that implements swap() method somehow follow the second case > > road also? For example, could you somehow deduce T* from buffer and swap > 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 point on > 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 not use virtual function based solution then? I bet it will be incomparably more simple to understand and probably easier to use. Gennadiy. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost