我得到了这个“警告C4290:忽略C ++异常规范,除了表示函数不是__declspec(nothrow)”代码中的几行

时间:2014-06-11 18:33:40

标签: c++ visual-c++

如何修复此警告?由于此警告,代码无法继续编译。请给我一些建议!非常感谢!我复制了代码的四个部分 警告指向。

 template <typename T>
std::vector<StructNodeElem<T> *> *_groupStructOfString(const char *data) throw(const char *){
  std::istringstream is(data);
  std::vector<StructNodeElem<T> *> *gstruct = new std::vector<StructNodeElem<T> *>;


template <typename T>
std::vector<StructNodeElem<T> *> *_readGroupStruct(const char *file) throw(const char *){
  std::ifstream infile;
  infile.open (file, ifstream::in);
  if(! infile.good())
    throw("readGroupStruct: cannot open file");


template <typename T>
std::vector<StructNodeElem<T> *> *_simpleGroupTree(int *degr, int n) throw(const char *){
  std::vector<int> degrees;
  for(int i = 0;i < n;i++)
    degrees.push_back(degr[i]);




template <typename T>
Vector<T> *_graphOfGroupStruct(std::vector<StructNodeElem<T> *> *gstruct,SpMatrix<bool> **pgroups,SpMatrix<bool> **pgroups_var) throw(const char *) {
  int nb_vars;
  Vector<T> *peta_g;
  if (! checkGroupTree<T>(gstruct,false,&nb_vars))
    throw("graphOfGroupStruct: bad input data");




template <typename T>
int _treeOfGroupStruct(std::vector<StructNodeElem<T> *> *gstruct,int **pperm,int *pnb_vars,Vector<T> **peta_g,SpMatrix<bool> **pgroups,Vector<int> **pown_variables,Vector<int> **pN_own_variables) throw(const char *){
  int nb_vars;
  *pnb_vars = 0;
  if (! checkGroupTree<T>(gstruct,true,&nb_vars))
    throw("treeOfGroupStruct: bad input data");

1 个答案:

答案 0 :(得分:2)

检查msdn http://msdn.microsoft.com/en-us/library/sa28fef8.aspx

摘要,只需使用编译语#pragma warning( disable : 4290 )