Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::statechart "custom::reaction"
From: Igor R (boost.lists_at_[hidden])
Date: 2013-11-05 05:48:38


>>
>> 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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net