0

我想我没有忘记";" ..

我不知道为什么我有这个错误

class Erreur : public std::exception
{

private:
int m_numero;
int m_niveau;
std::string m_phrase;

public:

Erreur(int numero=0, int niveau=0, std::string const& phrase="") noexcept;

virtual ~Erreur() noexcept;

virtual const char* what() const noexcept;

int getNiveau() noexcept;

int getNumero() noexcept;
};

编译者说它来自:

Erreur(int numero=0, int niveau=0, std::string const& phrase="") noexcept;
4

1 回答 1

0

我认为您可能正在使用一些旧的编译器(我在 VS2010 上尝试过,但它不支持它。

要么升级你的编译器,要么尝试使用 throw()。

如果你想让你的函数不抛出任何异常,请使用 nothrow

于 2013-08-04T04:56:20.903 回答