C++中的pair类的定义中有两个typedef。他们有什么用途?代码中没有使用它们!C++对模板结构声明模糊!
template <class T1, class T2> struct pair
{
typedef T1 first_type;
typedef T2 second_type;
T1 first;
T2 second;
pair() : first(T1()), second(T2()) {}
pair(const T1& x, const T2& y) : first(x), second(y) {}
template <class U, class V>
pair (const pair<U,V> &p) : first(p.first), second(p.second) { }
}
在* what * code中没有用处为了得出这些类型定义没有被使用的结论,你检查了哪些特定的代码体? – AnT 2010-07-04 18:39:17
在宣言本身! – Kamran 2010-07-04 19:45:57