Home Template Template Parameters
Reply: 0

Template Template Parameters

user857 Published in March 24, 2018, 12:36 am

It seems understanding template template param will kill me :(, lemme explain what misconception i made in my mind which confuses me :

template<class T>
class B {}; // A templated class

Here is another code :

template<template<class X> class Z = B> // problem is in this line for me
class BB{}; 

note the line in parameter list of templated class BB , which is :

template<class X> class Z = B

now what i want to ask is what stops c++ to think that Z is not a another templated class Z i.e :

template<class X> class Z{

rather than thinking Class Z is templated parameter itself.

Thanks a lot, i really appreciate any help to remove this misconception from my mind)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.38371 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO