c++ - Template class name with <> mark -


  template<int32_t id= 0, class id_type = int32_t>   class event {   public:       typedef id_type type;       typedef event<id, id_type> event_obj_type;    .....   } 

about code, "event<id, id_type>" mean? class name <>, never seen before. enlighten me? thanks

event template : pattern creating similar classes @ compile time. if @ places of code make : event<0, int32_t> a; event<3, char> a;

two classes defined template. 1 id = 0, id_type = int32_t , other id = 3, id_type = char.

[edit] if decompose first one, class definition :

class event {     public:     typedef int32_t type;     typedef event event_obj_type;     .....   } 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -