Item 42 of Effective C++

From: Phantom (ghostwhoowalks_at_gmail.com)
Date: 12/27/04


Date: 27 Dec 2004 11:03:45 -0800

Hi All

I am a bit confused after reading Item 42 of Effective C++. It talks
about the usage of a class that stores void* and that templates that
use a private inheritance of this class do not suffer from code bloats
?

Is it true to assume that code bloats occur only if one of the member
variable in the class are of the template type ? Suppose I have a
template class defined as follows :

template <class T>
class blah
{
// methods omitted for brevity
private:
T* data_;
}

The above class when instantiated multiple times suffers a code bloat
as opposed to a class that uses the idea of using private inheritance
and storing the memers as void* ?

Thanks
A