I have typedefs defined inside a template class:
template <class T>
class ROIAlg{
public:
typedef std::vector<T> Waveform;
typedef typename Waveform::const_iterator Tick;
typedef std::pair<Tick, Tick> Region;
//etc.
};
and another class that uses them
template <class T>
class WaveformPropertiesAlg{
public:
WaveformPropertiesAlg();
private:
typename ROIAlg<T>::Region fCPR;
//etc.
};
The implementation of the constructor of WaveformPropertiesAlg:
template <class T>
WaveformPropertiesAlg<T>::WaveformPropertiesAlg():
fCPR(ROIAlg<T>::Tick(), ROIAlg<T>::Tick()) {
//etc
}
Another piece of code attempts to construct a WaveformPropertiesAlg<short int>
but compilation fails:
In instantiation of ‘WaveformPropertiesAlg<T>::WaveformPropertiesAlg() [with T = short int]’:
RawDigitAndWireComparisonAlg.cxx:13:77: required from here
WaveformPropertiesAlg.h:30:51: error: dependent-name ‘ROIAlg<T>::Tick’ is parsed as a non-type, but instantiation yields a type
fCPR(ROIAlg<T>::Tick(),ROIAlg<T>::Tick())
^
WaveformPropertiesAlg.h:30:51: note: say ‘typename ROIAlg<T>::Tick’ if a type is meant
I don't think a type is meant here because I'm calling the constructor of Tick. How can I do this?