首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

set的使用异常

2012-03-01 
set的使用错误?#pragmawarning(disable:4786)#includeset#includevector#includeiostreamusingnames

set的使用错误?
#pragma   warning(disable:4786)
#include   <set>
#include   <vector>
#include   <iostream>
using   namespace   std;

enum   eValueType   {   P6V   =   0,   P6C   =   1,   P25V   =   2,   P25C   =   3,   N25V   =   4,   N25C   =   5   };
typedef   set <   eValueType,   string   > ::value_type   SetType;

void   main()
{

set <   eValueType,   string   >   CommandsSet;
CommandsSet.insert(   SetType(   P6V,   "MEAS:VOLT?   P6V "   )   );
CommandsSet.insert(   SetType(   P6C,   "MEAS:CURR?   P6V "   )   );
CommandsSet.insert(   SetType(   P25V,   "MEAS:VOLT?   P25V "   )   );
CommandsSet.insert(   SetType(   P25C,   "MEAS:CURR?   P25V "   )   );
CommandsSet.insert(   SetType(   N25V,   "MEAS:VOLT?   N25V "   )   );
CommandsSet.insert(   SetType(   N25C,   "MEAS:CURR?   N25V "   )   );
}

编译错误:
error   C2564:   'enum   eValueType '   :   function-style   conversion   to   builtin   type   takes   only   one   argument

谢谢!

[解决办法]
兄弟啊,你在哪学的set的语法?set只能放一个类型啊。
你现在搞的那是map了。

热点排行