Share via


Templates for Constructors and Destructors

OverviewHow Do I

Although constructors and destructors reference the name of the class template twice, the template parameters should be referenced only once in the fully specified name.

template <class T, int i>
TempClass< T, i >::TempClass( void )
{
    TRACE( "TempClass created.\n" );
}

template <class T, int i>
TempClass< T, i >::~TempClass( void )
{
    TRACE( "TempClass destroyed.\n" );
}