The function, std::vector.push_back takes a paramater of the type: [const t &]. with t being the type that the vector was constructed with. What I need to do is convert [*this] to a [const t &]. Is there any way that I can do this?
This is the code that I have:
template< typename t >
class CSpawnableEntity{
STR m_sSpawnName;
public:
CSpawnableEntity( char *pSpawnName )
:m_sSpawnName( pSpawnName )
{
gpGlobals.entities.push_back( *this );
}
t New( ){ return new t; }
};
gpGlobals.entities is of the type std::vector< CSpawnablyEntity< CBase * > >. I need to know how I can get that code to compile by doing the things that I said above.