From 73ba1c3442dc7bb14a71183a98f6a08f9600f4e9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 28 Apr 2017 11:30:18 +0200 Subject: shiboken test/Photon: Properly define noexcept Defining noexcept as empty leads to a compile error when including of VS2015/U3. Introduce a macro PHOTON_NOEXCEPT and also enable it for VS2015. Amends change 6c44bbf45124973e8f1a8c35fb28f0537274a794 Task-number: PYSIDE-324 Change-Id: Ie3157f6e62c8e3fe443842513983582edf491d18 Reviewed-by: Christian Tismer --- tests/libsample/photon.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/libsample/photon.h b/tests/libsample/photon.h index e3baa12..d8b1be4 100644 --- a/tests/libsample/photon.h +++ b/tests/libsample/photon.h @@ -108,21 +108,23 @@ LIBSAMPLE_API int countValueDuplicators(const std::list= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) +# define PHOTON_NOEXCEPT noexcept +#else +# define PHOTON_NOEXCEPT #endif class Pointer { public: - Pointer() noexcept : px(0) {} + Pointer() PHOTON_NOEXCEPT : px(0) {} Pointer(int* p) : px(p) {} - void reset() noexcept { Pointer().swap(*this); } + void reset() PHOTON_NOEXCEPT { Pointer().swap(*this); } - int* get() const noexcept { return px; } + int* get() const PHOTON_NOEXCEPT { return px; } int& operator*() const { return *px; } - void swap(Pointer& rhs) noexcept + void swap(Pointer& rhs) PHOTON_NOEXCEPT { int* tmp = px; px = rhs.px; -- cgit v1.2.3