1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032957: Add Standard_Noexcept definition

into Standard_Macro.hxx and
employ Standard_Noexcept.
This commit is contained in:
ddzama
2022-08-17 11:11:26 +03:00
parent fd5c113a03
commit 1a1739b200
8 changed files with 36 additions and 13 deletions

View File

@@ -18,6 +18,7 @@
#include <Standard_Std.hxx>
#include <Standard_Stream.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Macro.hxx>
class Standard_Transient;
@@ -71,7 +72,7 @@ namespace opencascade {
}
//! Move constructor
handle (handle&& theHandle) noexcept : entity(theHandle.entity)
handle (handle&& theHandle) Standard_Noexcept : entity(theHandle.entity)
{
theHandle.entity = 0;
}
@@ -112,7 +113,7 @@ namespace opencascade {
}
//! Move operator
handle& operator= (handle&& theHandle) noexcept
handle& operator= (handle&& theHandle) Standard_Noexcept
{
std::swap (this->entity, theHandle.entity);
return *this;

View File

@@ -315,5 +315,21 @@
#define Standard_ATOMIC(theType) theType
#endif
//! @def Standard_Noexcept
//! Definition of Standard_Noexcept:
//! if noexcept is accessible, Standard_Noexcept is "noexcept" and "throw()" otherwise.
#ifdef _MSC_VER
#if _MSC_VER >= 1900
#define Standard_Noexcept noexcept
#else
#define Standard_Noexcept throw()
#endif
#else
#if __cplusplus >= 201103L
#define Standard_Noexcept noexcept
#else
#define Standard_Noexcept throw()
#endif
#endif
#endif