Flexibility of template alias in C++0x

后端 未结 2 2149
夕颜
夕颜 2021-02-12 16:27

As I understand, template aliases in C++0x will allow us to do the following:

template 
using Dictionary = std::map< std::string, T >;

D         


        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 17:08

    The syntax is:

    template 
    using ValueType = typename std::iterator_traits::value_type;
    

    as with your second one.

    Source: http://www2.research.att.com/~bs/C++0xFAQ.html#template-alias

    Their example is:

    template
        using int_exact = typename int_exact_traits::type;  // define alias for convenient notation
    

提交回复
热议问题