
5 Nov
2013
5 Nov
'13
10:48 a.m.
Where do you define the above "react" member function template?
*.cpp file
template< class MostDerived > sc::result NotReady::react( const PairingBaseEvents< MostDerived > & PAEvent){ if (typeid(EntryEvent).name() == typeid(PAEvent).name()) { outermost_context().maxPairedDevices++; return discard_event(); } }
i Have a mpl:list defined in another header file.
If you define a function template in cpp (not in the header), you have to instantiate this definition manually for all the types that the declaration gets instantiated for. If you want to rely on automatic template instantiation, define the function in the header file.