【问题标题】:Error in set of pair [closed]对中的错误[关闭]
【发布时间】:2017-12-30 13:24:06
【问题描述】:

我已经声明了以下集合:

set< pair<string, pair< int, vector<int> > > SS;

为什么会出现以下错误?

temp.cpp: In function ‘int main()’:
temp.cpp:13:50: error: template argument 1 is invalid
     set< pair<string, pair< int, vector<int> > > SS;
                                                  ^
temp.cpp:13:50: error: template argument 2 is invalid
temp.cpp:13:50: error: template argument 3 is invalid

source

【问题讨论】:

  • 缺少右尖括号 (&gt;)。

标签: c++ stl set


【解决方案1】:

您缺少&gt;。您的代码应如下所示:

set< pair<string, pair< int, vector<int> > > > SS;

【讨论】:

    猜你喜欢
    • 2018-05-17
    • 1970-01-01
    • 2015-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多