Commit 18193744 authored by Mark Lindner's avatar Mark Lindner

Use noexcept in C++17.

parent 52b00231
......@@ -43,6 +43,12 @@
#define LIBCONFIGXX_VER_MINOR 7
#define LIBCONFIGXX_VER_REVISION 0
#if __cplusplus < 201103L
#define LIBCONFIGXX_NOEXCEPT throw()
#else
#define LIBCONFIGXX_NOEXCEPT noexcept
#endif
struct config_t; // fwd decl
struct config_setting_t; // fwd decl
......@@ -66,11 +72,11 @@ class LIBCONFIGXX_API SettingException : public ConfigException
SettingException(const SettingException &other);
SettingException& operator=(const SettingException &other);
virtual ~SettingException() throw();
virtual ~SettingException() LIBCONFIGXX_NOEXCEPT;
const char *getPath() const;
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
private:
......@@ -85,7 +91,7 @@ class LIBCONFIGXX_API SettingTypeException : public SettingException
SettingTypeException(const Setting &setting, int idx);
SettingTypeException(const Setting &setting, const char *name);
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
};
class LIBCONFIGXX_API SettingNotFoundException : public SettingException
......@@ -96,7 +102,7 @@ class LIBCONFIGXX_API SettingNotFoundException : public SettingException
SettingNotFoundException(const Setting &setting, int idx);
SettingNotFoundException(const Setting &setting, const char *name);
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
};
class LIBCONFIGXX_API SettingNameException : public SettingException
......@@ -105,14 +111,14 @@ class LIBCONFIGXX_API SettingNameException : public SettingException
SettingNameException(const Setting &setting, const char *name);
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
};
class LIBCONFIGXX_API FileIOException : public ConfigException
{
public:
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
};
class LIBCONFIGXX_API ParseException : public ConfigException
......@@ -123,7 +129,7 @@ class LIBCONFIGXX_API ParseException : public ConfigException
ParseException(const ParseException &other);
virtual ~ParseException() throw();
virtual ~ParseException() LIBCONFIGXX_NOEXCEPT;
inline const char *getFile() const
{ return(_file); }
......@@ -134,7 +140,7 @@ class LIBCONFIGXX_API ParseException : public ConfigException
inline const char *getError() const
{ return(_error); }
virtual const char *what() const throw();
virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
private:
......
......@@ -65,14 +65,14 @@ ParseException::ParseException(const ParseException &other)
// ---------------------------------------------------------------------------
ParseException::~ParseException() throw()
ParseException::~ParseException() LIBCONFIGXX_NOEXCEPT
{
::free((void *)_file);
}
// ---------------------------------------------------------------------------
const char *ParseException::what() const throw()
const char *ParseException::what() const LIBCONFIGXX_NOEXCEPT
{
return("ParseException");
}
......@@ -211,14 +211,14 @@ SettingException &SettingException::operator=(const SettingException &other)
// ---------------------------------------------------------------------------
const char *SettingException::what() const throw()
const char *SettingException::what() const LIBCONFIGXX_NOEXCEPT
{
return("SettingException");
}
// ---------------------------------------------------------------------------
SettingException::~SettingException() throw()
SettingException::~SettingException() LIBCONFIGXX_NOEXCEPT
{
::free(_path);
}
......@@ -247,7 +247,7 @@ SettingTypeException::SettingTypeException(const Setting &setting,
// ---------------------------------------------------------------------------
const char *SettingTypeException::what() const throw()
const char *SettingTypeException::what() const LIBCONFIGXX_NOEXCEPT
{
return("SettingTypeException");
}
......@@ -277,7 +277,7 @@ SettingNotFoundException::SettingNotFoundException(const char *path)
// ---------------------------------------------------------------------------
const char *SettingNotFoundException::what() const throw()
const char *SettingNotFoundException::what() const LIBCONFIGXX_NOEXCEPT
{
return("SettingNotFoundException");
}
......@@ -292,14 +292,14 @@ SettingNameException::SettingNameException(const Setting &setting,
// ---------------------------------------------------------------------------
const char *SettingNameException::what() const throw()
const char *SettingNameException::what() const LIBCONFIGXX_NOEXCEPT
{
return("SettingNameException");
}
// ---------------------------------------------------------------------------
const char *FileIOException::what() const throw()
const char *FileIOException::what() const LIBCONFIGXX_NOEXCEPT
{
return("FileIOException");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment