template parameters not deducible in partial specialization

Leseratte bookreader@gmx.com
Fri Nov 18 15:20:00 GMT 2016


Hello,

i have a base template class like this:

template<uint8_t num, typename T> class A { ... }

and I want to place the implementation differences in specialized templates 
like this:

template<uint8_t num, typename T> class A<0, uint8_t> { ... }
template<uint8_t num, typename T> class A<1, uint16_t> { ... }
template<uint8_t num, typename T> class A<2, uint8_t> { ... }

I use compiler from trunk compiled for target avr and I get the error:

sample.h:291:15: error: template parameters not deducible in partial 
specialization:
         class A<0, uint8_t>
               ^~~~~~~~~~~~~~~~~
sample.h:291:15: note:         'num'
sample.h:291:15: note:         'T'


I read that template with different integer values should work, so what's my 
fault?


best regards

Reinhard



More information about the Gcc-help mailing list