building and accessing a list of types at compile time

后端 未结 2 989
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 06:05

I am trying to achieve the following using c++ template metaprogramming. I wish to build up a list of types and then collect these types together and do further compile-time

2条回答
  •  天涯浪人
    2020-11-27 06:24

    A solution utilizing a common header, variadic templates and a macro:

    // Header common.h
    
    // A distinct Void type
    struct Void {};
    
    template  struct concat;
    
    template