Template typedefs - What's your work around?

后端 未结 3 591
梦谈多话
梦谈多话 2020-11-29 00:22

C++ 0x has template aliases (sometimes referred to as template typedefs). See here. Current spec of C++ does not.

What do you like to use as work around ? Container

3条回答
  •  半阙折子戏
    2020-11-29 00:52

    Sometimes you can just explicitly write out the untemplated typedefs for all the necessary types. If the base class is templated on multiple template args with only one type desired to be typedefed you can inherit a specialized class with typedef effectively included in the inherited class name. This approach is less abstruse than the metafunction approach.

提交回复
热议问题