Re: template parameters not deducible in partial specialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Fr 18. Nov 2016, 18:18:47 schrieb Jonathan Wakely:
> On 18 November 2016 at 14:20, Leseratte wrote:
> > 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> { ... }
> 
> Your syntax is wrong ...
> template<> class A<0, uint8_t> { ... }

OK, that was my first try, but with that specialization neither num nor T is 
known in the specialization, wich gives me bunch of errors, like:

error: 'T' does not name a type: did you mean '...

Well, to be more precise: nothing of the general definition is known at 
specialization time.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux