Variadic templates

前端 未结 8 1919
野趣味
野趣味 2020-12-06 00:05

I have seen a lot of links introducing the variadic templates. But I have never seen any compilable example that demonstrates this approach.

Could someone provide me

8条回答
  •  -上瘾入骨i
    2020-12-06 00:50

    another syntax: expanding, e.g.

    template
    class MyMaps
    {
      typedef std::tuple< std::map... > Maps;
    }
    

    hence:

    MyMaps:Maps
    

    is now actually:

    std::tuple,std::map >
    

提交回复
热议问题