Code: Select all
template< typename T >
class Accumulator
{
public:
T Value();
T operator = ( T val );
private:
T m_val;
};
However, once it hits the linker, all hell breaks loose:
Code: Select all
c:/djgpp/bin/ld-elf.exe: kernel.o: Unrecognized storage class 127 for /4 symbol `__ZN11AccumulatorIj
EaSEj'
c:/djgpp/bin/ld-elf.exe: kernel.o: Unrecognized storage class 127 for /44 symbol `__ZN11AccumulatorI
jE5ValueEv'
Code: Select all
Accumulator<int> acc;
acc = 0;
int val = acc.Value();
Edit: solution is on next page...