Using a templated parameter's value_type

后端 未结 3 1908
时光说笑
时光说笑 2021-02-13 01:15

How is one supposed to use a std container\'s value_type?
I tried to use it like so:

#include 

using namespace std;

template 

        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 02:01

    Use the typename keyword to indicate that it's really a type.

    void push(typename T::value_type& item)
    
    typename T::value_type pop()
    

提交回复
热议问题