C++ macro/metaprogram to determine number of members at compile time

后端 未结 5 1547
鱼传尺愫
鱼传尺愫 2020-12-18 07:15

I am working on an application with a message based / asynchronous agent-like architecture. There will be a few dozen distinct message types, each represented by C++ types.<

5条回答
  •  独厮守ぢ
    2020-12-18 07:44

    Plain structs do not support counting members, but boost::fusion offers a good way to declare a struct that is count- and iteratable.

提交回复
热议问题