From 9fad3dba6020c2411465c5eed138c9081bc9a27b Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 May 2018 23:30:39 +0200 Subject: [PATCH] general: remove macros for compatibility with non-C++11 compilers Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code. --- dtool/src/dtoolbase/dtoolbase_cc.h | 141 ++---------------- dtool/src/dtoolbase/fakestringstream.h | 2 - dtool/src/dtoolbase/memoryHook.I | 2 +- dtool/src/dtoolbase/memoryHook.h | 2 +- dtool/src/dtoolbase/mutexDummyImpl.h | 7 +- dtool/src/dtoolbase/mutexPosixImpl.I | 8 +- dtool/src/dtoolbase/mutexPosixImpl.h | 14 +- dtool/src/dtoolbase/mutexSpinlockImpl.I | 2 +- dtool/src/dtoolbase/mutexSpinlockImpl.h | 7 +- dtool/src/dtoolbase/mutexWin32Impl.h | 5 +- dtool/src/dtoolbase/nearly_zero.h | 6 +- dtool/src/dtoolbase/pallocator.T | 4 +- dtool/src/dtoolbase/pallocator.h | 8 +- dtool/src/dtoolbase/pvector.h | 17 +-- dtool/src/dtoolbase/typeHandle.I | 6 +- dtool/src/dtoolbase/typeHandle.h | 10 +- dtool/src/dtoolbase/typedObject.h | 6 +- dtool/src/dtoolutil/filename.I | 25 +--- dtool/src/dtoolutil/filename.h | 14 +- dtool/src/prc/notifyCategory.I | 4 +- dtool/src/prc/notifyCategory.h | 4 +- dtool/src/prc/notifyCategoryProxy.I | 4 +- dtool/src/prc/notifyCategoryProxy.h | 4 +- dtool/src/prc/streamWrapper.h | 4 +- makepanda/makepanda.py | 2 - panda/src/bullet/bulletTriangleMesh.h | 2 +- panda/src/display/displayRegion.I | 5 - panda/src/display/graphicsEngine.cxx | 2 +- panda/src/display/graphicsPipe.h | 5 +- panda/src/display/graphicsStateGuardian.h | 2 +- panda/src/event/asyncFuture.h | 2 +- panda/src/event/asyncTask.h | 4 +- panda/src/event/eventParameter.h | 2 +- panda/src/event/pythonTask.h | 2 +- panda/src/express/nodePointerTo.I | 16 +- panda/src/express/nodePointerTo.h | 20 +-- panda/src/express/nodePointerToBase.I | 6 +- panda/src/express/nodePointerToBase.h | 6 +- panda/src/express/pointerTo.I | 52 +++---- panda/src/express/pointerTo.h | 44 +++--- panda/src/express/pointerToArray.I | 28 +--- panda/src/express/pointerToArray.h | 24 +-- panda/src/express/pointerToArrayBase.I | 4 +- panda/src/express/pointerToArrayBase.h | 5 +- panda/src/express/pointerToBase.I | 6 +- panda/src/express/pointerToBase.h | 9 +- panda/src/express/pointerToVoid.I | 8 +- panda/src/express/pointerToVoid.h | 8 +- panda/src/express/weakPointerToBase.I | 4 +- panda/src/express/weakPointerToBase.h | 4 +- panda/src/glstuff/glCgShaderContext_src.h | 2 +- panda/src/glstuff/glShaderContext_src.h | 2 +- panda/src/glstuff/glTextureContext_src.h | 2 +- panda/src/gobj/geom.I | 8 +- panda/src/gobj/geom.h | 19 +-- panda/src/gobj/geomMunger.cxx | 5 +- panda/src/gobj/geomPrimitive.h | 9 +- panda/src/gobj/geomVertexArrayData.I | 2 +- panda/src/gobj/geomVertexArrayData.h | 2 +- panda/src/gobj/geomVertexArrayFormat.cxx | 22 +-- panda/src/gobj/geomVertexArrayFormat.h | 2 +- panda/src/gobj/geomVertexColumn.I | 2 +- panda/src/gobj/geomVertexColumn.h | 14 +- panda/src/gobj/geomVertexData.I | 12 +- panda/src/gobj/geomVertexData.cxx | 5 +- panda/src/gobj/geomVertexData.h | 17 +-- panda/src/gobj/geomVertexFormat.h | 2 +- panda/src/gobj/geomVertexReader.I | 2 +- panda/src/gobj/geomVertexRewriter.I | 4 +- panda/src/gobj/geomVertexWriter.I | 2 +- panda/src/gobj/internalName.I | 18 +-- panda/src/gobj/internalName.h | 15 +- panda/src/gobj/preparedGraphicsObjects.h | 4 +- panda/src/gobj/shaderBuffer.h | 2 +- panda/src/gobj/texture.cxx | 4 +- panda/src/gobj/texture_ext.cxx | 6 +- panda/src/linmath/lpoint2_src.h | 2 +- panda/src/linmath/lpoint3_src.h | 2 +- panda/src/linmath/lpoint4_src.h | 2 +- panda/src/linmath/lvecBase2_src.h | 6 +- panda/src/linmath/lvecBase3_src.h | 6 +- panda/src/linmath/lvecBase4_src.h | 12 +- panda/src/linmath/lvector2_src.h | 2 +- panda/src/linmath/lvector3_src.h | 2 +- panda/src/linmath/lvector4_src.h | 2 +- panda/src/mathutil/geometricBoundingVolume.h | 4 +- panda/src/pgraph/cullableObject.cxx | 5 - panda/src/pgraph/geomNode.I | 10 +- panda/src/pgraph/geomNode.h | 8 +- panda/src/pgraph/nodePath.I | 6 +- panda/src/pgraph/nodePath.cxx | 2 +- panda/src/pgraph/nodePath.h | 11 +- panda/src/pgraph/nodePathCollection.h | 2 +- panda/src/pgraph/nodePathComponent.h | 2 +- panda/src/pgraph/pandaNode.I | 26 ++-- panda/src/pgraph/pandaNode.h | 24 ++- panda/src/pgraph/paramNodePath.I | 6 +- panda/src/pgraph/paramNodePath.h | 5 +- panda/src/pgraph/renderAttrib.h | 2 +- panda/src/pgraph/renderAttribRegistry.I | 2 +- panda/src/pgraph/renderAttribRegistry.h | 2 +- panda/src/pgraph/shaderInput.I | 66 ++++---- panda/src/pgraph/shaderInput.cxx | 6 +- panda/src/pgraph/shaderInput.h | 2 +- panda/src/pgraph/transformState.h | 2 +- panda/src/pgraphnodes/ambientLight.h | 2 +- panda/src/pgraphnodes/directionalLight.h | 2 +- panda/src/pgraphnodes/pointLight.h | 4 +- panda/src/pgraphnodes/rectangleLight.h | 2 +- panda/src/pgraphnodes/spotlight.h | 6 +- panda/src/pipeline/cycleData.h | 6 +- panda/src/pipeline/cycleDataLockedReader.I | 6 +- panda/src/pipeline/cycleDataLockedReader.h | 8 +- .../src/pipeline/cycleDataLockedStageReader.I | 6 +- .../src/pipeline/cycleDataLockedStageReader.h | 8 +- panda/src/pipeline/cycleDataStageWriter.I | 6 +- panda/src/pipeline/cycleDataStageWriter.h | 10 +- panda/src/pipeline/cycleDataWriter.I | 6 +- panda/src/pipeline/cycleDataWriter.h | 8 +- panda/src/pipeline/lightMutex.I | 28 ---- panda/src/pipeline/lightMutex.h | 8 +- panda/src/pipeline/lightMutexDirect.I | 30 ---- panda/src/pipeline/lightMutexDirect.h | 10 +- panda/src/pipeline/lightReMutexDirect.I | 27 ---- panda/src/pipeline/lightReMutexDirect.h | 8 +- panda/src/pipeline/mutexDebug.I | 16 -- panda/src/pipeline/mutexDebug.h | 6 +- panda/src/pipeline/mutexDirect.I | 30 ---- panda/src/pipeline/mutexDirect.h | 10 +- panda/src/pipeline/mutexSimpleImpl.h | 2 +- panda/src/pipeline/pmutex.I | 28 ---- panda/src/pipeline/pmutex.h | 8 +- panda/src/pipeline/reMutex.I | 15 -- panda/src/pipeline/reMutex.h | 8 +- panda/src/pipeline/reMutexDirect.I | 27 ---- panda/src/pipeline/reMutexDirect.h | 8 +- panda/src/putil/bitArray.I | 6 +- panda/src/putil/bitArray.h | 6 +- panda/src/putil/bitMask.I | 6 +- panda/src/putil/bitMask.h | 6 +- panda/src/putil/buttonHandle.I | 4 +- panda/src/putil/buttonHandle.h | 8 +- panda/src/putil/copyOnWritePointer.I | 20 +-- panda/src/putil/copyOnWritePointer.h | 26 ++-- panda/src/putil/doubleBitMask.I | 6 +- panda/src/putil/doubleBitMask.h | 6 +- panda/src/putil/factoryParams.I | 10 +- panda/src/putil/factoryParams.h | 6 +- panda/src/putil/iterator_types.h | 6 +- panda/src/putil/simpleHashMap.I | 8 +- panda/src/putil/simpleHashMap.h | 12 +- panda/src/putil/updateSeq.I | 14 +- panda/src/putil/updateSeq.h | 12 +- panda/src/putil/weakKeyHashMap.I | 8 +- panda/src/putil/weakKeyHashMap.h | 11 +- panda/src/putil/writableParam.h | 2 +- panda/src/recorder/mouseRecorder.h | 6 +- panda/src/recorder/socketStreamRecorder.h | 6 +- panda/src/text/textAssembler.cxx | 8 +- 159 files changed, 522 insertions(+), 1021 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 81968085bc..491bd92c22 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -33,16 +33,7 @@ using namespace std; #define INLINE inline #define ALWAYS_INLINE inline #define TYPENAME typename -#define CONSTEXPR constexpr -#define ALWAYS_INLINE_CONSTEXPR constexpr -#define NOEXCEPT noexcept -#define FINAL final #define MOVE(x) x -#define DEFAULT_CTOR = default -#define DEFAULT_DTOR = default -#define DEFAULT_ASSIGN = default -#define DELETED = delete -#define DELETED_ASSIGN = delete #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname) @@ -81,15 +72,9 @@ typedef int ios_seekdir; #include #include -#ifdef HAVE_NAMESPACE using namespace std; -#endif -#ifdef HAVE_TYPENAME #define TYPENAME typename -#else -#define TYPENAME -#endif #ifndef HAVE_WCHAR_T // Some C++ libraries (os x 3.1) don't define this. @@ -124,18 +109,20 @@ typedef ios::seekdir ios_seekdir; #if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719 #include -using std::tr1::tuple; -using std::tr1::tie; +namespace std { + using std::tr1::tuple; + using std::tr1::tie; -typedef decltype(nullptr) nullptr_t; + typedef decltype(nullptr) nullptr_t; -template struct remove_reference {typedef T type;}; -template struct remove_reference {typedef T type;}; -template struct remove_reference{typedef T type;}; + template struct remove_reference {typedef T type;}; + template struct remove_reference {typedef T type;}; + template struct remove_reference{typedef T type;}; -template typename remove_reference::type &&move(T &&t) { - return static_cast::type&&>(t); -} + template typename remove_reference::type &&move(T &&t) { + return static_cast::type&&>(t); + } +}; #endif #ifdef _MSC_VER @@ -156,110 +143,12 @@ template typename remove_reference::type &&move(T &&t) { #endif // Determine the availability of C++11 features. -#if defined(__has_extension) // Clang magic. -# if __has_extension(cxx_constexpr) -# if !defined(__apple_build_version__) || __apple_build_version__ >= 5000000 -# define CONSTEXPR constexpr -# endif -# endif -# if __has_extension(cxx_noexcept) -# define NOEXCEPT noexcept -# endif -# if __has_extension(cxx_rvalue_references) && (__cplusplus >= 201103L) -# define USE_MOVE_SEMANTICS -# define MOVE(x) move(x) -# endif -# if __has_extension(cxx_override_control) && (__cplusplus >= 201103L) -# define FINAL final -# endif -# if __has_extension(cxx_defaulted_functions) -# define DEFAULT_CTOR = default -# define DEFAULT_DTOR = default -# define DEFAULT_ASSIGN = default -# endif -# if __has_extension(cxx_deleted_functions) -# define DELETED = delete -# endif -#elif defined(__GNUC__) // GCC - -// Starting at GCC 4.4 -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define DEFAULT_CTOR = default -# define DEFAULT_DTOR = default -# define DEFAULT_ASSIGN = default -# define DELETED = delete -# endif - -// Starting at GCC 4.6 -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -# define CONSTEXPR constexpr -# define NOEXCEPT noexcept -# define USE_MOVE_SEMANTICS -# define MOVE(x) move(x) -# endif - -// Starting at GCC 4.7 -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) -# define FINAL final -# endif - -// GCC defines several macros which we can query. List of all supported -// builtin macros: https://gcc.gnu.org/projects/cxx-status.html -# if !defined(CONSTEXPR) && __cpp_constexpr >= 200704 -# define CONSTEXPR constexpr -# endif - -#elif defined(_MSC_VER) && _MSC_VER >= 1900 // Visual Studio 2015 -# define CONSTEXPR constexpr -# define NOEXCEPT noexcept -# define USE_MOVE_SEMANTICS -# define FINAL final -# define MOVE(x) move(x) -#elif defined(_MSC_VER) && _MSC_VER >= 1600 // Visual Studio 2010 -# define NOEXCEPT throw() -# define USE_MOVE_SEMANTICS -# define FINAL sealed -# define MOVE(x) move(x) +#if defined(_MSC_VER) && _MSC_VER < 1900 // Visual Studio 2015 +#error Microsoft Visual C++ 2015 or later is required to compile Panda3D. #endif -#if defined(_MSC_VER) && _MSC_VER >= 1800 // Visual Studio 2013 -# define DEFAULT_CTOR = default -# define DEFAULT_DTOR = default -# define DEFAULT_ASSIGN = default -# define DELETED = delete -#endif - -// Fallbacks if features are not supported -#ifndef CONSTEXPR -# define CONSTEXPR INLINE -# define ALWAYS_INLINE_CONSTEXPR ALWAYS_INLINE -#else -# define ALWAYS_INLINE_CONSTEXPR ALWAYS_INLINE CONSTEXPR -#endif -#ifndef NOEXCEPT -# define NOEXCEPT -#endif -#ifndef MOVE -# define MOVE(x) x -#endif -#ifndef FINAL -# define FINAL -#endif -#ifndef DEFAULT_CTOR -# define DEFAULT_CTOR {} -#endif -#ifndef DEFAULT_DTOR -# define DEFAULT_DTOR {} -#endif -#ifndef DEFAULT_ASSIGN -# define DEFAULT_ASSIGN {return *this;} -#endif -#ifndef DELETED -# define DELETED {assert(false);} -# define DELETED_ASSIGN {assert(false);return *this;} -#else -# define DELETED_ASSIGN DELETED -#endif +// This is just to support code generated with older versions of interrogate. +#define MOVE(x) (std::move(x)) #ifndef LINK_ALL_STATIC diff --git a/dtool/src/dtoolbase/fakestringstream.h b/dtool/src/dtoolbase/fakestringstream.h index 6711eb8d2a..4ff2a971f0 100644 --- a/dtool/src/dtoolbase/fakestringstream.h +++ b/dtool/src/dtoolbase/fakestringstream.h @@ -18,9 +18,7 @@ #include #include -#ifdef HAVE_NAMESPACE using namespace std; -#endif class fake_istream_buffer { public: diff --git a/dtool/src/dtoolbase/memoryHook.I b/dtool/src/dtoolbase/memoryHook.I index bd5a55af79..055856f37b 100644 --- a/dtool/src/dtoolbase/memoryHook.I +++ b/dtool/src/dtoolbase/memoryHook.I @@ -38,7 +38,7 @@ dec_heap(size_t size) { * Returns the global memory alignment. This is the number of bytes at which * each allocated memory pointer will be aligned. */ -CONSTEXPR size_t MemoryHook:: +constexpr size_t MemoryHook:: get_memory_alignment() { return MEMORY_HOOK_ALIGNMENT; } diff --git a/dtool/src/dtoolbase/memoryHook.h b/dtool/src/dtoolbase/memoryHook.h index 9472983d75..b5fceacd53 100644 --- a/dtool/src/dtoolbase/memoryHook.h +++ b/dtool/src/dtoolbase/memoryHook.h @@ -52,7 +52,7 @@ public: bool heap_trim(size_t pad); - CONSTEXPR static size_t get_memory_alignment(); + constexpr static size_t get_memory_alignment(); virtual void *mmap_alloc(size_t size, bool allow_exec); virtual void mmap_free(void *ptr, size_t size); diff --git a/dtool/src/dtoolbase/mutexDummyImpl.h b/dtool/src/dtoolbase/mutexDummyImpl.h index cbb6132f90..3474d443ed 100644 --- a/dtool/src/dtoolbase/mutexDummyImpl.h +++ b/dtool/src/dtoolbase/mutexDummyImpl.h @@ -23,11 +23,10 @@ */ class EXPCL_DTOOL_DTOOLBASE MutexDummyImpl { public: - CONSTEXPR MutexDummyImpl() DEFAULT_CTOR; + constexpr MutexDummyImpl() = default; + MutexDummyImpl(const MutexDummyImpl ©) = delete; -private: - MutexDummyImpl(const MutexDummyImpl ©) DELETED; - MutexDummyImpl &operator = (const MutexDummyImpl ©) DELETED_ASSIGN; + MutexDummyImpl &operator = (const MutexDummyImpl ©) = delete; public: ALWAYS_INLINE void lock(); diff --git a/dtool/src/dtoolbase/mutexPosixImpl.I b/dtool/src/dtoolbase/mutexPosixImpl.I index 5b884dcde5..0bc338a2eb 100644 --- a/dtool/src/dtoolbase/mutexPosixImpl.I +++ b/dtool/src/dtoolbase/mutexPosixImpl.I @@ -14,8 +14,8 @@ /** * */ -CONSTEXPR MutexPosixImpl:: -MutexPosixImpl() NOEXCEPT : _lock(PTHREAD_MUTEX_INITIALIZER) { +constexpr MutexPosixImpl:: +MutexPosixImpl() noexcept : _lock(PTHREAD_MUTEX_INITIALIZER) { } /** @@ -63,8 +63,8 @@ unlock() { * */ #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP -CONSTEXPR ReMutexPosixImpl:: -ReMutexPosixImpl() NOEXCEPT : _lock(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) { +constexpr ReMutexPosixImpl:: +ReMutexPosixImpl() noexcept : _lock(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) { } #else INLINE ReMutexPosixImpl:: diff --git a/dtool/src/dtoolbase/mutexPosixImpl.h b/dtool/src/dtoolbase/mutexPosixImpl.h index 6baf70d962..996001b114 100644 --- a/dtool/src/dtoolbase/mutexPosixImpl.h +++ b/dtool/src/dtoolbase/mutexPosixImpl.h @@ -28,12 +28,11 @@ */ class EXPCL_DTOOL_DTOOLBASE MutexPosixImpl { public: - CONSTEXPR MutexPosixImpl() NOEXCEPT; + constexpr MutexPosixImpl() noexcept; + MutexPosixImpl(const MutexPosixImpl ©) = delete; INLINE ~MutexPosixImpl(); -private: - MutexPosixImpl(const MutexPosixImpl ©) DELETED; - MutexPosixImpl &operator = (const MutexPosixImpl ©) DELETED_ASSIGN; + MutexPosixImpl &operator = (const MutexPosixImpl ©) = delete; public: INLINE void lock(); @@ -51,15 +50,14 @@ private: class EXPCL_DTOOL_DTOOLBASE ReMutexPosixImpl { public: #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP - CONSTEXPR ReMutexPosixImpl() NOEXCEPT; + constexpr ReMutexPosixImpl() noexcept; #else INLINE ReMutexPosixImpl(); #endif + ReMutexPosixImpl(const ReMutexPosixImpl ©) = delete; INLINE ~ReMutexPosixImpl(); -private: - ReMutexPosixImpl(const ReMutexPosixImpl ©) DELETED; - ReMutexPosixImpl &operator = (const ReMutexPosixImpl ©) DELETED; + ReMutexPosixImpl &operator = (const ReMutexPosixImpl ©) = delete; public: INLINE void lock(); diff --git a/dtool/src/dtoolbase/mutexSpinlockImpl.I b/dtool/src/dtoolbase/mutexSpinlockImpl.I index 97838772d2..b3eb084181 100644 --- a/dtool/src/dtoolbase/mutexSpinlockImpl.I +++ b/dtool/src/dtoolbase/mutexSpinlockImpl.I @@ -14,7 +14,7 @@ /** * */ -CONSTEXPR MutexSpinlockImpl:: +constexpr MutexSpinlockImpl:: MutexSpinlockImpl() : _lock(0) { } diff --git a/dtool/src/dtoolbase/mutexSpinlockImpl.h b/dtool/src/dtoolbase/mutexSpinlockImpl.h index 0c51522b1e..c7dfb72cf2 100644 --- a/dtool/src/dtoolbase/mutexSpinlockImpl.h +++ b/dtool/src/dtoolbase/mutexSpinlockImpl.h @@ -29,11 +29,10 @@ */ class EXPCL_DTOOL_DTOOLBASE MutexSpinlockImpl { public: - CONSTEXPR MutexSpinlockImpl(); + constexpr MutexSpinlockImpl(); + MutexSpinlockImpl(const MutexSpinlockImpl ©) = delete; -private: - MutexSpinlockImpl(const MutexSpinlockImpl ©) DELETED; - MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) DELETED_ASSIGN; + MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) = delete; public: INLINE void lock(); diff --git a/dtool/src/dtoolbase/mutexWin32Impl.h b/dtool/src/dtoolbase/mutexWin32Impl.h index 017832694c..550d4944ab 100644 --- a/dtool/src/dtoolbase/mutexWin32Impl.h +++ b/dtool/src/dtoolbase/mutexWin32Impl.h @@ -29,11 +29,10 @@ class EXPCL_DTOOL_DTOOLBASE MutexWin32Impl { public: MutexWin32Impl(); + MutexWin32Impl(const MutexWin32Impl ©) = delete; INLINE ~MutexWin32Impl(); -private: - MutexWin32Impl(const MutexWin32Impl ©) DELETED; - MutexWin32Impl &operator = (const MutexWin32Impl ©) DELETED_ASSIGN; + MutexWin32Impl &operator = (const MutexWin32Impl ©) = delete; public: INLINE void lock(); diff --git a/dtool/src/dtoolbase/nearly_zero.h b/dtool/src/dtoolbase/nearly_zero.h index af71ad9419..0f31fdfb2e 100644 --- a/dtool/src/dtoolbase/nearly_zero.h +++ b/dtool/src/dtoolbase/nearly_zero.h @@ -24,17 +24,17 @@ // identifier, and then returning the value of that identifier, seems to lead // to compilation errors (at least in VC7) in which sometimes // IS_THRESHOLD_COMPEQ(a, a, get_nearly_zero_value(a)) != 0. -CONSTEXPR double +constexpr double get_nearly_zero_value(double) { return 1.0e-12; } -CONSTEXPR float +constexpr float get_nearly_zero_value(float) { return 1.0e-6f; } -CONSTEXPR int +constexpr int get_nearly_zero_value(int) { // This is a bit silly, but we should nevertheless define it in case it is // called for an integer type. diff --git a/dtool/src/dtoolbase/pallocator.T b/dtool/src/dtoolbase/pallocator.T index e9bfd3f98e..59af0f0ec1 100644 --- a/dtool/src/dtoolbase/pallocator.T +++ b/dtool/src/dtoolbase/pallocator.T @@ -13,7 +13,7 @@ template INLINE pallocator_single:: -pallocator_single(TypeHandle type_handle) NOEXCEPT : +pallocator_single(TypeHandle type_handle) noexcept : _type_handle(type_handle) { } @@ -37,7 +37,7 @@ deallocate(TYPENAME pallocator_single::pointer p, TYPENAME pallocator_sing template INLINE pallocator_array:: -pallocator_array(TypeHandle type_handle) NOEXCEPT : +pallocator_array(TypeHandle type_handle) noexcept : _type_handle(type_handle) { } diff --git a/dtool/src/dtoolbase/pallocator.h b/dtool/src/dtoolbase/pallocator.h index 3c91b6cc7e..8dfbb8178d 100644 --- a/dtool/src/dtoolbase/pallocator.h +++ b/dtool/src/dtoolbase/pallocator.h @@ -52,11 +52,11 @@ public: typedef TYPENAME allocator::const_reference const_reference; typedef TYPENAME allocator::size_type size_type; - INLINE pallocator_single(TypeHandle type_handle) NOEXCEPT; + INLINE pallocator_single(TypeHandle type_handle) noexcept; // template member functions in VC++ can only be defined in-class. template - INLINE pallocator_single(const pallocator_single ©) NOEXCEPT : + INLINE pallocator_single(const pallocator_single ©) noexcept : _type_handle(copy._type_handle) { } INLINE Type *allocate(size_type n, allocator::const_pointer hint = 0) @@ -81,11 +81,11 @@ public: typedef TYPENAME allocator::const_reference const_reference; typedef TYPENAME allocator::size_type size_type; - INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) NOEXCEPT; + INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) noexcept; // template member functions in VC++ can only be defined in-class. template - INLINE pallocator_array(const pallocator_array ©) NOEXCEPT : + INLINE pallocator_array(const pallocator_array ©) noexcept : _type_handle(copy._type_handle) { } INLINE Type *allocate(size_type n, allocator::const_pointer hint = 0) diff --git a/dtool/src/dtoolbase/pvector.h b/dtool/src/dtoolbase/pvector.h index 14bd542f37..8da0e88b85 100644 --- a/dtool/src/dtoolbase/pvector.h +++ b/dtool/src/dtoolbase/pvector.h @@ -43,27 +43,24 @@ class pvector : public vector > { public: typedef pallocator_array allocator; typedef vector base_class; - typedef TYPENAME base_class::size_type size_type; + typedef typename base_class::size_type size_type; explicit pvector(TypeHandle type_handle = pvector_type_handle) : base_class(allocator(type_handle)) { } pvector(const pvector ©) : base_class(copy) { } + pvector(pvector &&from) noexcept : base_class(move(from)) {}; explicit pvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type(), allocator(type_handle)) { } explicit pvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value, allocator(type_handle)) { } pvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end, allocator(type_handle)) { } -#ifdef USE_MOVE_SEMANTICS - pvector(pvector &&from) NOEXCEPT : base_class(move(from)) {}; - - pvector &operator =(pvector &&from) NOEXCEPT { - base_class::operator =(move(from)); - return *this; - } -#endif - pvector &operator =(const pvector ©) { base_class::operator =(copy); return *this; } + + pvector &operator =(pvector &&from) noexcept { + base_class::operator =(move(from)); + return *this; + } }; #endif // USE_STL_ALLOCATOR diff --git a/dtool/src/dtoolbase/typeHandle.I b/dtool/src/dtoolbase/typeHandle.I index 3e9e53a9ae..bb7a737bf2 100644 --- a/dtool/src/dtoolbase/typeHandle.I +++ b/dtool/src/dtoolbase/typeHandle.I @@ -194,7 +194,7 @@ output(ostream &out) const { /** * Returns a special zero-valued TypeHandle that is used to indicate no type. */ -CONSTEXPR TypeHandle TypeHandle:: +constexpr TypeHandle TypeHandle:: none() { return TypeHandle(0); } @@ -213,7 +213,7 @@ operator bool () const { * * See TypeRegistry::find_type_by_id(). */ -CONSTEXPR TypeHandle TypeHandle:: +constexpr TypeHandle TypeHandle:: from_index(int index) { return TypeHandle(index); } @@ -222,6 +222,6 @@ from_index(int index) { * Private constructor for initializing a TypeHandle from an index, used by * none() and by from_index(). */ -CONSTEXPR TypeHandle:: +constexpr TypeHandle:: TypeHandle(int index) : _index(index) { } diff --git a/dtool/src/dtoolbase/typeHandle.h b/dtool/src/dtoolbase/typeHandle.h index 3138d51e4b..ed539e0619 100644 --- a/dtool/src/dtoolbase/typeHandle.h +++ b/dtool/src/dtoolbase/typeHandle.h @@ -78,9 +78,9 @@ class TypedObject; * that ancestry of a particular type may be queried, and the type name may be * retrieved for run-time display. */ -class EXPCL_DTOOL_DTOOLBASE TypeHandle FINAL { +class EXPCL_DTOOL_DTOOLBASE TypeHandle final { PUBLISHED: - TypeHandle() NOEXCEPT DEFAULT_CTOR; + TypeHandle() noexcept = default; enum MemoryClass { MC_singleton, @@ -129,7 +129,7 @@ PUBLISHED: INLINE int get_index() const; INLINE void output(ostream &out) const; - CONSTEXPR static TypeHandle none(); + constexpr static TypeHandle none(); INLINE operator bool () const; MAKE_PROPERTY(index, get_index); @@ -142,10 +142,10 @@ public: void *reallocate_array(void *ptr, size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT); void deallocate_array(void *ptr); - CONSTEXPR static TypeHandle from_index(int index); + constexpr static TypeHandle from_index(int index); private: - CONSTEXPR TypeHandle(int index); + constexpr TypeHandle(int index); // Only kept temporarily for ABI compatibility. static TypeHandle _none; diff --git a/dtool/src/dtoolbase/typedObject.h b/dtool/src/dtoolbase/typedObject.h index f3d6c193e3..dd60515f16 100644 --- a/dtool/src/dtoolbase/typedObject.h +++ b/dtool/src/dtoolbase/typedObject.h @@ -87,9 +87,9 @@ */ class EXPCL_DTOOL_DTOOLBASE TypedObject : public MemoryBase { public: - INLINE TypedObject() DEFAULT_CTOR; - INLINE TypedObject(const TypedObject ©) DEFAULT_CTOR; - INLINE TypedObject &operator = (const TypedObject ©) DEFAULT_ASSIGN; + INLINE TypedObject() = default; + INLINE TypedObject(const TypedObject ©) = default; + INLINE TypedObject &operator = (const TypedObject ©) = default; PUBLISHED: // A virtual destructor is just a good idea. diff --git a/dtool/src/dtoolutil/filename.I b/dtool/src/dtoolutil/filename.I index 9bc23dfca3..2f099548e3 100644 --- a/dtool/src/dtoolutil/filename.I +++ b/dtool/src/dtoolutil/filename.I @@ -54,24 +54,20 @@ Filename(const Filename ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Filename:: -Filename(string &&filename) NOEXCEPT { - _flags = 0; - (*this) = move(filename); +Filename(string &&filename) noexcept : _flags(0) { + (*this) = std::move(filename); } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Filename:: -Filename(Filename &&from) NOEXCEPT : - _filename(move(from._filename)), +Filename(Filename &&from) noexcept : + _filename(std::move(from._filename)), _dirname_end(from._dirname_end), _basename_start(from._basename_start), _basename_end(from._basename_end), @@ -81,7 +77,6 @@ Filename(Filename &&from) NOEXCEPT : _flags(from._flags) { } -#endif // USE_MOVE_SEMANTICS /** * Creates an empty Filename. @@ -217,28 +212,25 @@ operator = (const Filename ©) { return *this; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Filename &Filename:: -operator = (string &&filename) NOEXCEPT { - _filename = move(filename); +operator = (string &&filename) noexcept { + _filename = std::move(filename); locate_basename(); locate_extension(); locate_hash(); return *this; } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Filename &Filename:: -operator = (Filename &&from) NOEXCEPT { - _filename = move(from._filename); +operator = (Filename &&from) noexcept { + _filename = std::move(from._filename); _dirname_end = from._dirname_end; _basename_start = from._basename_start; _basename_end = from._basename_end; @@ -248,7 +240,6 @@ operator = (Filename &&from) NOEXCEPT { _flags = from._flags; return *this; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/dtool/src/dtoolutil/filename.h b/dtool/src/dtoolutil/filename.h index 76ee5e0b39..07927a846c 100644 --- a/dtool/src/dtoolutil/filename.h +++ b/dtool/src/dtoolutil/filename.h @@ -58,11 +58,8 @@ public: INLINE Filename(const string &filename); INLINE Filename(const wstring &filename); INLINE Filename(const Filename ©); - -#ifdef USE_MOVE_SEMANTICS - INLINE Filename(string &&filename) NOEXCEPT; - INLINE Filename(Filename &&from) NOEXCEPT; -#endif + INLINE Filename(string &&filename) noexcept; + INLINE Filename(Filename &&from) noexcept; PUBLISHED: INLINE Filename(); @@ -106,11 +103,8 @@ PUBLISHED: INLINE Filename &operator = (const wstring &filename); INLINE Filename &operator = (const char *filename); INLINE Filename &operator = (const Filename ©); - -#ifdef USE_MOVE_SEMANTICS - INLINE Filename &operator = (string &&filename) NOEXCEPT; - INLINE Filename &operator = (Filename &&from) NOEXCEPT; -#endif + INLINE Filename &operator = (string &&filename) noexcept; + INLINE Filename &operator = (Filename &&from) noexcept; // And retrieval is by any of the classic string operations. INLINE operator const string & () const; diff --git a/dtool/src/prc/notifyCategory.I b/dtool/src/prc/notifyCategory.I index 46aca56bb2..62a332b388 100644 --- a/dtool/src/prc/notifyCategory.I +++ b/dtool/src/prc/notifyCategory.I @@ -88,7 +88,7 @@ is_debug() const { * "debug" severities, and these methods are redefined to be static to make it * more obvious to the compiler. */ -CONSTEXPR bool NotifyCategory:: +constexpr bool NotifyCategory:: is_spam() { return false; } @@ -98,7 +98,7 @@ is_spam() { * "debug" severities, and these methods are redefined to be static to make it * more obvious to the compiler. */ -CONSTEXPR bool NotifyCategory:: +constexpr bool NotifyCategory:: is_debug() { return false; } diff --git a/dtool/src/prc/notifyCategory.h b/dtool/src/prc/notifyCategory.h index 61f4e71906..ee25b56268 100644 --- a/dtool/src/prc/notifyCategory.h +++ b/dtool/src/prc/notifyCategory.h @@ -55,8 +55,8 @@ PUBLISHED: INLINE bool is_spam() const; INLINE bool is_debug() const; #else - CONSTEXPR static bool is_spam(); - CONSTEXPR static bool is_debug(); + constexpr static bool is_spam(); + constexpr static bool is_debug(); #endif INLINE bool is_info() const; INLINE bool is_warning() const; diff --git a/dtool/src/prc/notifyCategoryProxy.I b/dtool/src/prc/notifyCategoryProxy.I index 9a05f35625..8c0a5dc47d 100644 --- a/dtool/src/prc/notifyCategoryProxy.I +++ b/dtool/src/prc/notifyCategoryProxy.I @@ -74,7 +74,7 @@ is_spam() { } #else template -CONSTEXPR bool NotifyCategoryProxy:: +constexpr bool NotifyCategoryProxy:: is_spam() { return false; } @@ -92,7 +92,7 @@ is_debug() { } #else template -CONSTEXPR bool NotifyCategoryProxy:: +constexpr bool NotifyCategoryProxy:: is_debug() { return false; } diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index 653da558de..eaa83a8282 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -75,8 +75,8 @@ public: INLINE bool is_spam(); INLINE bool is_debug(); #else - CONSTEXPR static bool is_spam(); - CONSTEXPR static bool is_debug(); + constexpr static bool is_spam(); + constexpr static bool is_debug(); #endif INLINE bool is_info(); INLINE bool is_warning(); diff --git a/dtool/src/prc/streamWrapper.h b/dtool/src/prc/streamWrapper.h index f3e4028c1b..62e57fa9e1 100644 --- a/dtool/src/prc/streamWrapper.h +++ b/dtool/src/prc/streamWrapper.h @@ -24,9 +24,7 @@ class EXPCL_DTOOL_PRC StreamWrapperBase { protected: INLINE StreamWrapperBase(); - -private: - INLINE StreamWrapperBase(const StreamWrapperBase ©) DELETED; + INLINE StreamWrapperBase(const StreamWrapperBase ©) = delete; PUBLISHED: INLINE void acquire(); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 56ffecdbd5..5c42bb9bf5 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2272,12 +2272,10 @@ DTOOL_CONFIG=[ ("DO_PIPELINING", '1', '1'), ("DEFAULT_PATHSEP", '";"', '":"'), ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'), - ("HAVE_NAMESPACE", '1', '1'), ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'), ("HAVE_LOCKF", '1', '1'), ("HAVE_WCHAR_T", '1', '1'), ("HAVE_WSTRING", '1', '1'), - ("HAVE_TYPENAME", '1', '1'), ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'), ("HAVE_DINKUM", 'UNDEF', 'UNDEF'), ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'), diff --git a/panda/src/bullet/bulletTriangleMesh.h b/panda/src/bullet/bulletTriangleMesh.h index 0f9cb8174b..27c0598b13 100644 --- a/panda/src/bullet/bulletTriangleMesh.h +++ b/panda/src/bullet/bulletTriangleMesh.h @@ -32,7 +32,7 @@ class EXPCL_PANDABULLET BulletTriangleMesh : public TypedWritableReferenceCount { PUBLISHED: BulletTriangleMesh(); - ~BulletTriangleMesh() DEFAULT_DTOR; + ~BulletTriangleMesh() = default; void add_triangle(const LPoint3 &p0, const LPoint3 &p1, diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index 8982461879..e402e0ad7b 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -479,13 +479,8 @@ INLINE void DisplayRegion:: set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup, Thread *current_thread) { CDCullWriter cdata(_cycler_cull, true, current_thread); -#ifdef USE_MOVE_SEMANTICS cdata->_cull_result = move(cull_result); cdata->_scene_setup = move(scene_setup); -#else - swap(cdata->_cull_result, cull_result); - swap(cdata->_scene_setup, scene_setup); -#endif } /** diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index f65c5377fc..b3f931e44b 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -1538,7 +1538,7 @@ cull_to_bins(GraphicsEngine::Windows wlist, Thread *current_thread) { } // Save the results for next frame. - dr->set_cull_result(MOVE(cull_result), MOVE(scene_setup), current_thread); + dr->set_cull_result(move(cull_result), MOVE(scene_setup), current_thread); } } } diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index f7994b92e1..501cc535be 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -52,9 +52,8 @@ class DisplayInformation; class EXPCL_PANDA_DISPLAY GraphicsPipe : public TypedReferenceCount { protected: GraphicsPipe(); -private: - GraphicsPipe(const GraphicsPipe ©) DELETED; - GraphicsPipe &operator = (const GraphicsPipe ©) DELETED_ASSIGN; + GraphicsPipe(const GraphicsPipe ©) = delete; + GraphicsPipe &operator = (const GraphicsPipe ©) = delete; PUBLISHED: virtual ~GraphicsPipe(); diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index e508be9c6a..fecce7e56a 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -286,7 +286,7 @@ PUBLISHED: MAKE_PROPERTY(driver_shader_version_minor, get_driver_shader_version_minor); bool set_scene(SceneSetup *scene_setup); - virtual SceneSetup *get_scene() const FINAL; + virtual SceneSetup *get_scene() const final; MAKE_PROPERTY(scene, get_scene, set_scene); public: diff --git a/panda/src/event/asyncFuture.h b/panda/src/event/asyncFuture.h index cbed94b158..18d5b773f1 100644 --- a/panda/src/event/asyncFuture.h +++ b/panda/src/event/asyncFuture.h @@ -160,7 +160,7 @@ INLINE ostream &operator << (ostream &out, const AsyncFuture &fut) { /** * Specific future that collects the results of several futures. */ -class EXPCL_PANDA_EVENT AsyncGatheringFuture FINAL : public AsyncFuture { +class EXPCL_PANDA_EVENT AsyncGatheringFuture final : public AsyncFuture { private: AsyncGatheringFuture(AsyncFuture::Futures futures); diff --git a/panda/src/event/asyncTask.h b/panda/src/event/asyncTask.h index 9712daa0f5..e36c3c8324 100644 --- a/panda/src/event/asyncTask.h +++ b/panda/src/event/asyncTask.h @@ -103,8 +103,8 @@ protected: void jump_to_task_chain(AsyncTaskManager *manager); DoneStatus unlock_and_do_task(); - virtual bool cancel() FINAL; - virtual bool is_task() const FINAL {return true;} + virtual bool cancel() final; + virtual bool is_task() const final {return true;} virtual bool is_runnable(); virtual DoneStatus do_task(); diff --git a/panda/src/event/eventParameter.h b/panda/src/event/eventParameter.h index 65dbf550c8..24ea3ec1e2 100644 --- a/panda/src/event/eventParameter.h +++ b/panda/src/event/eventParameter.h @@ -34,7 +34,7 @@ */ class EXPCL_PANDA_EVENT EventParameter { PUBLISHED: - INLINE EventParameter() DEFAULT_CTOR; + INLINE EventParameter() = default; INLINE EventParameter(nullptr_t) {}; INLINE EventParameter(const TypedWritableReferenceCount *ptr); INLINE EventParameter(const TypedReferenceCount *ptr); diff --git a/panda/src/event/pythonTask.h b/panda/src/event/pythonTask.h index 48826769de..33dde9af0a 100644 --- a/panda/src/event/pythonTask.h +++ b/panda/src/event/pythonTask.h @@ -26,7 +26,7 @@ * This class exists to allow association of a Python function or coroutine * with the AsyncTaskManager. */ -class PythonTask FINAL : public AsyncTask { +class PythonTask final : public AsyncTask { PUBLISHED: PythonTask(PyObject *function = Py_None, const string &name = string()); virtual ~PythonTask(); diff --git a/panda/src/express/nodePointerTo.I b/panda/src/express/nodePointerTo.I index 5485adcaaa..c035cd34cf 100644 --- a/panda/src/express/nodePointerTo.I +++ b/panda/src/express/nodePointerTo.I @@ -33,14 +33,13 @@ NodePointerTo(const NodePointerTo ©) : } #endif // CPPPARSER -#ifdef USE_MOVE_SEMANTICS #ifndef CPPPARSER /** * */ template INLINE NodePointerTo:: -NodePointerTo(NodePointerTo &&from) NOEXCEPT : +NodePointerTo(NodePointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } @@ -52,12 +51,11 @@ NodePointerTo(NodePointerTo &&from) NOEXCEPT : */ template INLINE NodePointerTo &NodePointerTo:: -operator = (NodePointerTo &&from) NOEXCEPT { +operator = (NodePointerTo &&from) noexcept { this->reassign(move(from)); return *this; } #endif // CPPPARSER -#endif // USE_MOVE_SEMANTICS #ifndef CPPPARSER /** @@ -167,14 +165,13 @@ NodeConstPointerTo(const NodeConstPointerTo ©) : } #endif // CPPPARSER -#ifdef USE_MOVE_SEMANTICS #ifndef CPPPARSER /** * */ template INLINE NodeConstPointerTo:: -NodeConstPointerTo(NodePointerTo &&from) NOEXCEPT : +NodeConstPointerTo(NodePointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } @@ -186,7 +183,7 @@ NodeConstPointerTo(NodePointerTo &&from) NOEXCEPT : */ template INLINE NodeConstPointerTo:: -NodeConstPointerTo(NodeConstPointerTo &&from) NOEXCEPT : +NodeConstPointerTo(NodeConstPointerTo &&from) noexcept : NodePointerToBase((NodePointerToBase &&)from) { } @@ -198,7 +195,7 @@ NodeConstPointerTo(NodeConstPointerTo &&from) NOEXCEPT : */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: -operator = (NodePointerTo &&from) NOEXCEPT { +operator = (NodePointerTo &&from) noexcept { this->reassign(move(from)); return *this; } @@ -210,12 +207,11 @@ operator = (NodePointerTo &&from) NOEXCEPT { */ template INLINE NodeConstPointerTo &NodeConstPointerTo:: -operator = (NodeConstPointerTo &&from) NOEXCEPT { +operator = (NodeConstPointerTo &&from) noexcept { this->reassign(move(from)); return *this; } #endif // CPPPARSER -#endif // USE_MOVE_SEMANTICS #ifndef CPPPARSER /** diff --git a/panda/src/express/nodePointerTo.h b/panda/src/express/nodePointerTo.h index ca9832d424..169aeb71e5 100644 --- a/panda/src/express/nodePointerTo.h +++ b/panda/src/express/nodePointerTo.h @@ -31,11 +31,9 @@ public: typedef TYPENAME NodePointerToBase::To To; INLINE NodePointerTo(To *ptr = (To *)NULL); INLINE NodePointerTo(const NodePointerTo ©); + INLINE NodePointerTo(NodePointerTo &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE NodePointerTo(NodePointerTo &&from) NOEXCEPT; - INLINE NodePointerTo &operator = (NodePointerTo &&from) NOEXCEPT; -#endif + INLINE NodePointerTo &operator = (NodePointerTo &&from) noexcept; INLINE To &operator *() const; INLINE To *operator -> () const; @@ -65,13 +63,11 @@ public: INLINE NodeConstPointerTo(const To *ptr = (const To *)NULL); INLINE NodeConstPointerTo(const NodePointerTo ©); INLINE NodeConstPointerTo(const NodeConstPointerTo ©); + INLINE NodeConstPointerTo(NodePointerTo &&from) noexcept; + INLINE NodeConstPointerTo(NodeConstPointerTo &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE NodeConstPointerTo(NodePointerTo &&from) NOEXCEPT; - INLINE NodeConstPointerTo(NodeConstPointerTo &&from) NOEXCEPT; - INLINE NodeConstPointerTo &operator = (NodePointerTo &&from) NOEXCEPT; - INLINE NodeConstPointerTo &operator = (NodeConstPointerTo &&from) NOEXCEPT; -#endif + INLINE NodeConstPointerTo &operator = (NodePointerTo &&from) noexcept; + INLINE NodeConstPointerTo &operator = (NodeConstPointerTo &&from) noexcept; INLINE const To &operator *() const; INLINE const To *operator -> () const; @@ -86,12 +82,12 @@ public: }; template -void swap(NodePointerTo &one, NodePointerTo &two) NOEXCEPT { +void swap(NodePointerTo &one, NodePointerTo &two) noexcept { one.swap(two); } template -void swap(NodeConstPointerTo &one, NodeConstPointerTo &two) NOEXCEPT { +void swap(NodeConstPointerTo &one, NodeConstPointerTo &two) noexcept { one.swap(two); } diff --git a/panda/src/express/nodePointerToBase.I b/panda/src/express/nodePointerToBase.I index 18f04def9a..1cb22132d5 100644 --- a/panda/src/express/nodePointerToBase.I +++ b/panda/src/express/nodePointerToBase.I @@ -38,13 +38,12 @@ INLINE NodePointerToBase:: reassign((To *)NULL); } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE NodePointerToBase:: -NodePointerToBase(NodePointerToBase &&from) NOEXCEPT { +NodePointerToBase(NodePointerToBase &&from) noexcept { _void_ptr = from._void_ptr; from._void_ptr = (void *)NULL; } @@ -57,7 +56,7 @@ NodePointerToBase(NodePointerToBase &&from) NOEXCEPT { */ template INLINE void NodePointerToBase:: -reassign(NodePointerToBase &&from) NOEXCEPT { +reassign(NodePointerToBase &&from) noexcept { To *old_ptr = (To *)this->_void_ptr; this->_void_ptr = from._void_ptr; @@ -68,7 +67,6 @@ reassign(NodePointerToBase &&from) NOEXCEPT { node_unref_delete(old_ptr); } } -#endif // USE_MOVE_SEMANTICS /** * This is the main work of the NodePointerTo family. When the pointer is diff --git a/panda/src/express/nodePointerToBase.h b/panda/src/express/nodePointerToBase.h index e7bb9ad526..0b28a5c6bc 100644 --- a/panda/src/express/nodePointerToBase.h +++ b/panda/src/express/nodePointerToBase.h @@ -36,11 +36,9 @@ protected: INLINE NodePointerToBase(To *ptr); INLINE NodePointerToBase(const NodePointerToBase ©); INLINE ~NodePointerToBase(); + INLINE NodePointerToBase(NodePointerToBase &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE NodePointerToBase(NodePointerToBase &&from) NOEXCEPT; - INLINE void reassign(NodePointerToBase &&from) NOEXCEPT; -#endif + INLINE void reassign(NodePointerToBase &&from) noexcept; void reassign(To *ptr); INLINE void reassign(const NodePointerToBase ©); diff --git a/panda/src/express/pointerTo.I b/panda/src/express/pointerTo.I index 62962a83e3..bc71cfbfd9 100644 --- a/panda/src/express/pointerTo.I +++ b/panda/src/express/pointerTo.I @@ -16,7 +16,7 @@ */ template ALWAYS_INLINE PointerTo:: -PointerTo(To *ptr) NOEXCEPT : PointerToBase(ptr) { +PointerTo(To *ptr) noexcept : PointerToBase(ptr) { } /** @@ -29,13 +29,12 @@ PointerTo(const PointerTo ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE PointerTo:: -PointerTo(PointerTo &&from) NOEXCEPT : +PointerTo(PointerTo &&from) noexcept : PointerToBase(move(from)) { } @@ -45,18 +44,17 @@ PointerTo(PointerTo &&from) NOEXCEPT : */ template INLINE PointerTo &PointerTo:: -operator = (PointerTo &&from) NOEXCEPT { +operator = (PointerTo &&from) noexcept { this->reassign(move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS /** * */ template -CONSTEXPR TYPENAME PointerTo::To &PointerTo:: -operator *() const NOEXCEPT { +constexpr TYPENAME PointerTo::To &PointerTo:: +operator *() const noexcept { return *((To *)(this->_void_ptr)); } @@ -64,8 +62,8 @@ operator *() const NOEXCEPT { * */ template -CONSTEXPR TYPENAME PointerTo::To *PointerTo:: -operator -> () const NOEXCEPT { +constexpr TYPENAME PointerTo::To *PointerTo:: +operator -> () const noexcept { return (To *)(this->_void_ptr); } @@ -76,8 +74,8 @@ operator -> () const NOEXCEPT { * goes because either will be correct. */ template -CONSTEXPR PointerTo:: -operator T * () const NOEXCEPT { +constexpr PointerTo:: +operator T * () const noexcept { return (To *)(this->_void_ptr); } @@ -99,8 +97,8 @@ cheat() { * compiler problems, particularly for implicit upcasts. */ template -CONSTEXPR TYPENAME PointerTo::To *PointerTo:: -p() const NOEXCEPT { +constexpr TYPENAME PointerTo::To *PointerTo:: +p() const noexcept { return (To *)(this->_void_ptr); } @@ -129,7 +127,7 @@ operator = (const PointerTo ©) { */ template ALWAYS_INLINE ConstPointerTo:: -ConstPointerTo(const TYPENAME ConstPointerTo::To *ptr) NOEXCEPT : +ConstPointerTo(const TYPENAME ConstPointerTo::To *ptr) noexcept : PointerToBase((TYPENAME ConstPointerTo::To *)ptr) { } @@ -154,13 +152,12 @@ ConstPointerTo(const ConstPointerTo ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE ConstPointerTo:: -ConstPointerTo(PointerTo &&from) NOEXCEPT : +ConstPointerTo(PointerTo &&from) noexcept : PointerToBase(move(from)) { } @@ -170,7 +167,7 @@ ConstPointerTo(PointerTo &&from) NOEXCEPT : */ template INLINE ConstPointerTo:: -ConstPointerTo(ConstPointerTo &&from) NOEXCEPT : +ConstPointerTo(ConstPointerTo &&from) noexcept : PointerToBase(move(from)) { } @@ -180,7 +177,7 @@ ConstPointerTo(ConstPointerTo &&from) NOEXCEPT : */ template INLINE ConstPointerTo &ConstPointerTo:: -operator = (PointerTo &&from) NOEXCEPT { +operator = (PointerTo &&from) noexcept { this->reassign(move(from)); return *this; } @@ -190,18 +187,17 @@ operator = (PointerTo &&from) NOEXCEPT { */ template INLINE ConstPointerTo &ConstPointerTo:: -operator = (ConstPointerTo &&from) NOEXCEPT { +operator = (ConstPointerTo &&from) noexcept { this->reassign(move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS /** * */ template -CONSTEXPR const TYPENAME ConstPointerTo::To &ConstPointerTo:: -operator *() const NOEXCEPT { +constexpr const TYPENAME ConstPointerTo::To &ConstPointerTo:: +operator *() const noexcept { return *((To *)(this->_void_ptr)); } @@ -209,8 +205,8 @@ operator *() const NOEXCEPT { * */ template -CONSTEXPR const TYPENAME ConstPointerTo::To *ConstPointerTo:: -operator -> () const NOEXCEPT { +constexpr const TYPENAME ConstPointerTo::To *ConstPointerTo:: +operator -> () const noexcept { return (To *)(this->_void_ptr); } @@ -221,8 +217,8 @@ operator -> () const NOEXCEPT { * don't care which way it goes because either will be correct. */ template -CONSTEXPR ConstPointerTo:: -operator const T * () const NOEXCEPT { +constexpr ConstPointerTo:: +operator const T * () const noexcept { return (To *)(this->_void_ptr); } @@ -244,8 +240,8 @@ cheat() { * around compiler problems, particularly for implicit upcasts. */ template -CONSTEXPR const TYPENAME ConstPointerTo::To *ConstPointerTo:: -p() const NOEXCEPT { +constexpr const TYPENAME ConstPointerTo::To *ConstPointerTo:: +p() const noexcept { return (To *)(this->_void_ptr); } diff --git a/panda/src/express/pointerTo.h b/panda/src/express/pointerTo.h index 62abdf8e57..313ad41a55 100644 --- a/panda/src/express/pointerTo.h +++ b/panda/src/express/pointerTo.h @@ -70,20 +70,18 @@ class PointerTo : public PointerToBase { public: typedef TYPENAME PointerToBase::To To; PUBLISHED: - ALWAYS_INLINE_CONSTEXPR PointerTo() NOEXCEPT DEFAULT_CTOR; - ALWAYS_INLINE PointerTo(To *ptr) NOEXCEPT; + ALWAYS_INLINE constexpr PointerTo() noexcept = default; + ALWAYS_INLINE PointerTo(To *ptr) noexcept; INLINE PointerTo(const PointerTo ©); public: -#ifdef USE_MOVE_SEMANTICS - INLINE PointerTo(PointerTo &&from) NOEXCEPT; - INLINE PointerTo &operator = (PointerTo &&from) NOEXCEPT; -#endif + INLINE PointerTo(PointerTo &&from) noexcept; + INLINE PointerTo &operator = (PointerTo &&from) noexcept; - CONSTEXPR To &operator *() const NOEXCEPT; - CONSTEXPR To *operator -> () const NOEXCEPT; + constexpr To &operator *() const noexcept; + constexpr To *operator -> () const noexcept; // MSVC.NET 2005 insists that we use T *, and not To *, here. - CONSTEXPR operator T *() const NOEXCEPT; + constexpr operator T *() const noexcept; INLINE T *&cheat(); @@ -100,7 +98,7 @@ PUBLISHED: // the DCAST macro defined in typedObject.h instead, e.g. DCAST(MyType, // ptr). This provides a clean downcast that doesn't require .p() or any // double-casting, and it can be run-time checked for correctness. - CONSTEXPR To *p() const NOEXCEPT; + constexpr To *p() const noexcept; INLINE PointerTo &operator = (To *ptr); INLINE PointerTo &operator = (const PointerTo ©); @@ -133,27 +131,25 @@ class ConstPointerTo : public PointerToBase { public: typedef TYPENAME PointerToBase::To To; PUBLISHED: - ALWAYS_INLINE_CONSTEXPR ConstPointerTo() NOEXCEPT DEFAULT_CTOR; - ALWAYS_INLINE ConstPointerTo(const To *ptr) NOEXCEPT; + ALWAYS_INLINE constexpr ConstPointerTo() noexcept = default; + ALWAYS_INLINE ConstPointerTo(const To *ptr) noexcept; INLINE ConstPointerTo(const PointerTo ©); INLINE ConstPointerTo(const ConstPointerTo ©); public: -#ifdef USE_MOVE_SEMANTICS - INLINE ConstPointerTo(PointerTo &&from) NOEXCEPT; - INLINE ConstPointerTo(ConstPointerTo &&from) NOEXCEPT; - INLINE ConstPointerTo &operator = (PointerTo &&from) NOEXCEPT; - INLINE ConstPointerTo &operator = (ConstPointerTo &&from) NOEXCEPT; -#endif + INLINE ConstPointerTo(PointerTo &&from) noexcept; + INLINE ConstPointerTo(ConstPointerTo &&from) noexcept; + INLINE ConstPointerTo &operator = (PointerTo &&from) noexcept; + INLINE ConstPointerTo &operator = (ConstPointerTo &&from) noexcept; - CONSTEXPR const To &operator *() const NOEXCEPT; - CONSTEXPR const To *operator -> () const NOEXCEPT; - CONSTEXPR operator const T *() const NOEXCEPT; + constexpr const To &operator *() const noexcept; + constexpr const To *operator -> () const noexcept; + constexpr operator const T *() const noexcept; INLINE const T *&cheat(); PUBLISHED: - CONSTEXPR const To *p() const NOEXCEPT; + constexpr const To *p() const noexcept; INLINE ConstPointerTo &operator = (const To *ptr); INLINE ConstPointerTo &operator = (const PointerTo ©); @@ -173,12 +169,12 @@ PUBLISHED: // PointerTo objects without incurring the cost of unnecessary reference count // changes. The performance difference is dramatic! template -void swap(PointerTo &one, PointerTo &two) NOEXCEPT { +void swap(PointerTo &one, PointerTo &two) noexcept { one.swap(two); } template -void swap(ConstPointerTo &one, ConstPointerTo &two) NOEXCEPT { +void swap(ConstPointerTo &one, ConstPointerTo &two) noexcept { one.swap(two); } diff --git a/panda/src/express/pointerToArray.I b/panda/src/express/pointerToArray.I index 535de63d01..f665e38415 100644 --- a/panda/src/express/pointerToArray.I +++ b/panda/src/express/pointerToArray.I @@ -79,20 +79,17 @@ PointerToArray(const Element *begin, const Element *end, TypeHandle type_handle) { } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE PointerToArray:: -PointerToArray(PointerToArray &&from) NOEXCEPT : +PointerToArray(PointerToArray &&from) noexcept : PointerToArrayBase(move(from)), _type_handle(from._type_handle) { } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * Initializes the PTA from a vector. */ @@ -103,7 +100,6 @@ PointerToArray(pvector &&from, TypeHandle type_handle) : _type_handle(type_handle) { } -#endif // USE_MOVE_SEMANTICS /** * @@ -628,18 +624,16 @@ operator = (const PointerToArray ©) { return *this; } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE PointerToArray &PointerToArray:: -operator = (PointerToArray &&from) NOEXCEPT { +operator = (PointerToArray &&from) noexcept { _type_handle = from._type_handle; ((PointerToArray *)this)->reassign(move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS /** * To empty the PTA, use the clear() method, since assignment to NULL is @@ -697,33 +691,28 @@ ConstPointerToArray(const ConstPointerToArray ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE ConstPointerToArray:: -ConstPointerToArray(PointerToArray &&from) NOEXCEPT : +ConstPointerToArray(PointerToArray &&from) noexcept : PointerToArrayBase(move(from)), _type_handle(from._type_handle) { } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE ConstPointerToArray:: -ConstPointerToArray(ConstPointerToArray &&from) NOEXCEPT : +ConstPointerToArray(ConstPointerToArray &&from) noexcept : PointerToArrayBase(move(from)), _type_handle(from._type_handle) { } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * Initializes the PTA from a vector. */ @@ -734,7 +723,6 @@ ConstPointerToArray(pvector &&from, TypeHandle type_handle) : _type_handle(type_handle) { } -#endif // USE_MOVE_SEMANTICS /** * @@ -1090,31 +1078,27 @@ operator = (const ConstPointerToArray ©) { return *this; } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE ConstPointerToArray &ConstPointerToArray:: -operator = (PointerToArray &&from) NOEXCEPT { +operator = (PointerToArray &&from) noexcept { _type_handle = from._type_handle; ((ConstPointerToArray *)this)->reassign(move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE ConstPointerToArray &ConstPointerToArray:: -operator = (ConstPointerToArray &&from) NOEXCEPT { +operator = (ConstPointerToArray &&from) noexcept { _type_handle = from._type_handle; ((ConstPointerToArray *)this)->reassign(move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS /** * To empty the PTA, use the clear() method, since assignment to NULL is diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index 4e8a052e0f..251102f5e3 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -138,11 +138,8 @@ public: INLINE PointerToArray(size_type n, const Element &value, TypeHandle type_handle = get_type_handle(Element)); INLINE PointerToArray(const Element *begin, const Element *end, TypeHandle type_handle = get_type_handle(Element)); INLINE PointerToArray(const PointerToArray ©); - -#ifdef USE_MOVE_SEMANTICS - INLINE PointerToArray(PointerToArray &&from) NOEXCEPT; + INLINE PointerToArray(PointerToArray &&from) noexcept; INLINE explicit PointerToArray(pvector &&from, TypeHandle type_handle = get_type_handle(Element)); -#endif public: // Duplicating the interface of vector. The following member functions are @@ -224,11 +221,8 @@ public: operator = (ReferenceCountedVector *ptr); INLINE PointerToArray & operator = (const PointerToArray ©); - -#ifdef USE_MOVE_SEMANTICS INLINE PointerToArray & - operator = (PointerToArray &&from) NOEXCEPT; -#endif + operator = (PointerToArray &&from) noexcept; INLINE void clear(); @@ -299,12 +293,9 @@ PUBLISHED: INLINE ConstPointerToArray(const Element *begin, const Element *end, TypeHandle type_handle = get_type_handle(Element)); INLINE ConstPointerToArray(const PointerToArray ©); INLINE ConstPointerToArray(const ConstPointerToArray ©); - -#ifdef USE_MOVE_SEMANTICS - INLINE ConstPointerToArray(PointerToArray &&from) NOEXCEPT; - INLINE ConstPointerToArray(ConstPointerToArray &&from) NOEXCEPT; + INLINE ConstPointerToArray(PointerToArray &&from) noexcept; + INLINE ConstPointerToArray(ConstPointerToArray &&from) noexcept; INLINE explicit ConstPointerToArray(pvector &&from, TypeHandle type_handle = get_type_handle(Element)); -#endif // Duplicating the interface of vector. @@ -358,13 +349,10 @@ PUBLISHED: operator = (const PointerToArray ©); INLINE ConstPointerToArray & operator = (const ConstPointerToArray ©); - -#ifdef USE_MOVE_SEMANTICS INLINE ConstPointerToArray & - operator = (PointerToArray &&from) NOEXCEPT; + operator = (PointerToArray &&from) noexcept; INLINE ConstPointerToArray & - operator = (ConstPointerToArray &&from) NOEXCEPT; -#endif + operator = (ConstPointerToArray &&from) noexcept; INLINE void clear(); diff --git a/panda/src/express/pointerToArrayBase.I b/panda/src/express/pointerToArrayBase.I index de8c17d843..2b60162abc 100644 --- a/panda/src/express/pointerToArrayBase.I +++ b/panda/src/express/pointerToArrayBase.I @@ -132,17 +132,15 @@ PointerToArrayBase(const PointerToArrayBase ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE PointerToArrayBase:: -PointerToArrayBase(PointerToArrayBase &&from) NOEXCEPT : +PointerToArrayBase(PointerToArrayBase &&from) noexcept : PointerToBase >(move(from)) { } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/express/pointerToArrayBase.h b/panda/src/express/pointerToArrayBase.h index 8c33f69be2..6f6128e26b 100644 --- a/panda/src/express/pointerToArrayBase.h +++ b/panda/src/express/pointerToArrayBase.h @@ -73,10 +73,7 @@ public: protected: INLINE PointerToArrayBase(ReferenceCountedVector *ptr); INLINE PointerToArrayBase(const PointerToArrayBase ©); - -#ifdef USE_MOVE_SEMANTICS - INLINE PointerToArrayBase(PointerToArrayBase &&from) NOEXCEPT; -#endif + INLINE PointerToArrayBase(PointerToArrayBase &&from) noexcept; PUBLISHED: INLINE ~PointerToArrayBase(); diff --git a/panda/src/express/pointerToBase.I b/panda/src/express/pointerToBase.I index bf4ff877f0..27a02daa46 100644 --- a/panda/src/express/pointerToBase.I +++ b/panda/src/express/pointerToBase.I @@ -51,13 +51,12 @@ INLINE PointerToBase:: } } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE PointerToBase:: -PointerToBase(PointerToBase &&from) NOEXCEPT { +PointerToBase(PointerToBase &&from) noexcept { _void_ptr = from._void_ptr; from._void_ptr = (void *)NULL; } @@ -70,7 +69,7 @@ PointerToBase(PointerToBase &&from) NOEXCEPT { */ template INLINE void PointerToBase:: -reassign(PointerToBase &&from) NOEXCEPT { +reassign(PointerToBase &&from) noexcept { // Protect against self-move-assignment. if (from._void_ptr != this->_void_ptr) { To *old_ptr = (To *)this->_void_ptr; @@ -84,7 +83,6 @@ reassign(PointerToBase &&from) NOEXCEPT { } } } -#endif // USE_MOVE_SEMANTICS /** * This is the main work of the PointerTo family. When the pointer is diff --git a/panda/src/express/pointerToBase.h b/panda/src/express/pointerToBase.h index 919f596c33..4ac546993c 100644 --- a/panda/src/express/pointerToBase.h +++ b/panda/src/express/pointerToBase.h @@ -31,18 +31,15 @@ public: typedef T To; protected: - ALWAYS_INLINE_CONSTEXPR PointerToBase() NOEXCEPT DEFAULT_CTOR; + ALWAYS_INLINE constexpr PointerToBase() noexcept = default; INLINE PointerToBase(To *ptr); INLINE PointerToBase(const PointerToBase ©); + INLINE PointerToBase(PointerToBase &&from) noexcept; INLINE ~PointerToBase(); -#ifdef USE_MOVE_SEMANTICS - INLINE PointerToBase(PointerToBase &&from) NOEXCEPT; - INLINE void reassign(PointerToBase &&from) NOEXCEPT; -#endif - INLINE void reassign(To *ptr); INLINE void reassign(const PointerToBase ©); + INLINE void reassign(PointerToBase &&from) noexcept; INLINE void update_type(To *ptr); diff --git a/panda/src/express/pointerToVoid.I b/panda/src/express/pointerToVoid.I index ee3a36e303..c6f981a7fb 100644 --- a/panda/src/express/pointerToVoid.I +++ b/panda/src/express/pointerToVoid.I @@ -14,8 +14,8 @@ /** * */ -CONSTEXPR PointerToVoid:: -PointerToVoid() NOEXCEPT : _void_ptr(nullptr) { +constexpr PointerToVoid:: +PointerToVoid() noexcept : _void_ptr(nullptr) { } /** @@ -30,7 +30,7 @@ PointerToVoid() NOEXCEPT : _void_ptr(nullptr) { * Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct * comparison to a NULL pointer also works.) */ -CONSTEXPR bool PointerToVoid:: +constexpr bool PointerToVoid:: is_null() const { return _void_ptr == nullptr; } @@ -82,7 +82,7 @@ operator != (const PointerToVoid &other) const { * For internal use only. Use the global swap() function instead. */ INLINE void PointerToVoid:: -swap(PointerToVoid &other) NOEXCEPT { +swap(PointerToVoid &other) noexcept { AtomicAdjust::Pointer temp = _void_ptr; _void_ptr = other._void_ptr; other._void_ptr = temp; diff --git a/panda/src/express/pointerToVoid.h b/panda/src/express/pointerToVoid.h index 0d2c1d33e9..aca9ba15e7 100644 --- a/panda/src/express/pointerToVoid.h +++ b/panda/src/express/pointerToVoid.h @@ -32,14 +32,14 @@ */ class EXPCL_PANDAEXPRESS PointerToVoid : public MemoryBase { protected: - CONSTEXPR PointerToVoid() NOEXCEPT; + constexpr PointerToVoid() noexcept; //INLINE ~PointerToVoid(); private: - PointerToVoid(const PointerToVoid ©) DELETED; + PointerToVoid(const PointerToVoid ©) = delete; PUBLISHED: - CONSTEXPR bool is_null() const; + constexpr bool is_null() const; INLINE size_t get_hash() const; public: @@ -51,7 +51,7 @@ public: INLINE bool operator == (const PointerToVoid &other) const; INLINE bool operator != (const PointerToVoid &other) const; - INLINE void swap(PointerToVoid &other) NOEXCEPT; + INLINE void swap(PointerToVoid &other) noexcept; protected: // Within the PointerToVoid class, we only store a void pointer. This is diff --git a/panda/src/express/weakPointerToBase.I b/panda/src/express/weakPointerToBase.I index 252e5e9aa7..1c831529a1 100644 --- a/panda/src/express/weakPointerToBase.I +++ b/panda/src/express/weakPointerToBase.I @@ -63,7 +63,7 @@ WeakPointerToBase(const WeakPointerToBase ©) { */ template INLINE WeakPointerToBase:: -WeakPointerToBase(WeakPointerToBase &&from) NOEXCEPT { +WeakPointerToBase(WeakPointerToBase &&from) noexcept { // Protect against self-move-assignment. if (from._void_ptr != this->_void_ptr) { WeakReferenceList *old_ref = (To *)this->_weak_ref; @@ -163,7 +163,7 @@ reassign(const WeakPointerToBase ©) { */ template INLINE void WeakPointerToBase:: -reassign(WeakPointerToBase &&from) NOEXCEPT { +reassign(WeakPointerToBase &&from) noexcept { // Protect against self-move-assignment. if (from._void_ptr != this->_void_ptr) { WeakReferenceList *old_ref = (WeakReferenceList *)this->_weak_ref; diff --git a/panda/src/express/weakPointerToBase.h b/panda/src/express/weakPointerToBase.h index 6d3ce456b0..4870ef21d8 100644 --- a/panda/src/express/weakPointerToBase.h +++ b/panda/src/express/weakPointerToBase.h @@ -31,13 +31,13 @@ protected: INLINE WeakPointerToBase(To *ptr); INLINE WeakPointerToBase(const PointerToBase ©); INLINE WeakPointerToBase(const WeakPointerToBase ©); - INLINE WeakPointerToBase(WeakPointerToBase &&from) NOEXCEPT; + INLINE WeakPointerToBase(WeakPointerToBase &&from) noexcept; INLINE ~WeakPointerToBase(); void reassign(To *ptr); INLINE void reassign(const PointerToBase ©); INLINE void reassign(const WeakPointerToBase ©); - INLINE void reassign(WeakPointerToBase &&from) NOEXCEPT; + INLINE void reassign(WeakPointerToBase &&from) noexcept; INLINE void update_type(To *ptr); diff --git a/panda/src/glstuff/glCgShaderContext_src.h b/panda/src/glstuff/glCgShaderContext_src.h index d5bc721e61..63338b3520 100644 --- a/panda/src/glstuff/glCgShaderContext_src.h +++ b/panda/src/glstuff/glCgShaderContext_src.h @@ -25,7 +25,7 @@ class CLP(GraphicsStateGuardian); /** * xyz */ -class EXPCL_GL CLP(CgShaderContext) FINAL : public ShaderContext { +class EXPCL_GL CLP(CgShaderContext) final : public ShaderContext { public: friend class CLP(GraphicsStateGuardian); diff --git a/panda/src/glstuff/glShaderContext_src.h b/panda/src/glstuff/glShaderContext_src.h index 9ecfe9ed39..79ceeb713d 100644 --- a/panda/src/glstuff/glShaderContext_src.h +++ b/panda/src/glstuff/glShaderContext_src.h @@ -26,7 +26,7 @@ class CLP(GraphicsStateGuardian); /** * xyz */ -class EXPCL_GL CLP(ShaderContext) FINAL : public ShaderContext { +class EXPCL_GL CLP(ShaderContext) final : public ShaderContext { public: friend class CLP(GraphicsStateGuardian); diff --git a/panda/src/glstuff/glTextureContext_src.h b/panda/src/glstuff/glTextureContext_src.h index 9a345b397d..667e356d60 100644 --- a/panda/src/glstuff/glTextureContext_src.h +++ b/panda/src/glstuff/glTextureContext_src.h @@ -42,7 +42,7 @@ public: #endif #ifdef OPENGLES_1 - static CONSTEXPR bool needs_barrier(GLbitfield barrier) { return false; }; + static constexpr bool needs_barrier(GLbitfield barrier) { return false; }; #else bool needs_barrier(GLbitfield barrier); void mark_incoherent(bool wrote); diff --git a/panda/src/gobj/geom.I b/panda/src/gobj/geom.I index 413e2de055..0f504f4dac 100644 --- a/panda/src/gobj/geom.I +++ b/panda/src/gobj/geom.I @@ -443,17 +443,15 @@ CacheKey(const CacheKey ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Geom::CacheKey:: -CacheKey(CacheKey &&from) NOEXCEPT : +CacheKey(CacheKey &&from) noexcept : _source_data(move(from._source_data)), _modifier(move(from._modifier)) { } -#endif // USE_MOVE_SEMANTICS /** * Provides a unique ordering within the map. @@ -493,17 +491,15 @@ CacheEntry(Geom *source, const Geom::CacheKey &key) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE Geom::CacheEntry:: -CacheEntry(Geom *source, Geom::CacheKey &&key) NOEXCEPT : +CacheEntry(Geom *source, Geom::CacheKey &&key) noexcept : _source(source), _key(move(key)) { } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 50b050e578..41ac95adea 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -256,9 +256,8 @@ public: INLINE CacheKey(const GeomVertexData *source_data, const GeomMunger *modifier); INLINE CacheKey(const CacheKey ©); -#ifdef USE_MOVE_SEMANTICS - INLINE CacheKey(CacheKey &&from) NOEXCEPT; -#endif + INLINE CacheKey(CacheKey &&from) noexcept; + INLINE bool operator < (const CacheKey &other) const; CPT(GeomVertexData) _source_data; @@ -271,9 +270,8 @@ public: const GeomVertexData *source_data, const GeomMunger *modifier); INLINE CacheEntry(Geom *source, const CacheKey &key); -#ifdef USE_MOVE_SEMANTICS - INLINE CacheEntry(Geom *source, CacheKey &&key) NOEXCEPT; -#endif + INLINE CacheEntry(Geom *source, CacheKey &&key) noexcept; + ALLOC_DELETED_CHAIN(CacheEntry); virtual void evict_callback(); @@ -406,14 +404,13 @@ class EXPCL_PANDA_GOBJ GeomPipelineReader : public GeomEnums { public: INLINE GeomPipelineReader(Thread *current_thread); INLINE GeomPipelineReader(const Geom *object, Thread *current_thread); -private: - GeomPipelineReader(const GeomPipelineReader ©) DELETED; - GeomPipelineReader &operator = (const GeomPipelineReader ©) DELETED_ASSIGN; - -public: + GeomPipelineReader(const GeomPipelineReader ©) = delete; INLINE ~GeomPipelineReader(); + ALLOC_DELETED_CHAIN(GeomPipelineReader); + GeomPipelineReader &operator = (const GeomPipelineReader ©) = delete; + INLINE void set_object(const Geom *object); INLINE const Geom *get_object() const; INLINE Thread *get_current_thread() const; diff --git a/panda/src/gobj/geomMunger.cxx b/panda/src/gobj/geomMunger.cxx index fccbdab0b6..bbbc9e3522 100644 --- a/panda/src/gobj/geomMunger.cxx +++ b/panda/src/gobj/geomMunger.cxx @@ -147,12 +147,9 @@ munge_geom(CPT(Geom) &geom, CPT(GeomVertexData) &data, // Record the new result in the cache. if (entry == (Geom::CacheEntry *)NULL) { // Create a new entry for the result. -#ifdef USE_MOVE_SEMANTICS // We don't need the key anymore, move the pointers into the CacheEntry. entry = new Geom::CacheEntry(orig_geom, move(key)); -#else - entry = new Geom::CacheEntry(orig_geom, key); -#endif + { LightMutexHolder holder(orig_geom->_cache_lock); bool inserted = orig_geom->_cache.insert(Geom::Cache::value_type(&entry->_key, entry)).second; diff --git a/panda/src/gobj/geomPrimitive.h b/panda/src/gobj/geomPrimitive.h index 8748c86799..50cb5695aa 100644 --- a/panda/src/gobj/geomPrimitive.h +++ b/panda/src/gobj/geomPrimitive.h @@ -351,14 +351,13 @@ private: class EXPCL_PANDA_GOBJ GeomPrimitivePipelineReader : public GeomEnums { public: INLINE GeomPrimitivePipelineReader(CPT(GeomPrimitive) object, Thread *current_thread); -private: - GeomPrimitivePipelineReader(const GeomPrimitivePipelineReader ©) DELETED; - GeomPrimitivePipelineReader &operator = (const GeomPrimitivePipelineReader ©) DELETED_ASSIGN; - -public: + GeomPrimitivePipelineReader(const GeomPrimitivePipelineReader ©) = delete; INLINE ~GeomPrimitivePipelineReader(); + ALLOC_DELETED_CHAIN(GeomPrimitivePipelineReader); + GeomPrimitivePipelineReader &operator = (const GeomPrimitivePipelineReader ©) = delete; + INLINE const GeomPrimitive *get_object() const; INLINE Thread *get_current_thread() const; diff --git a/panda/src/gobj/geomVertexArrayData.I b/panda/src/gobj/geomVertexArrayData.I index 624525360d..97811498a4 100644 --- a/panda/src/gobj/geomVertexArrayData.I +++ b/panda/src/gobj/geomVertexArrayData.I @@ -239,7 +239,7 @@ CData(UsageHint usage_hint) : * */ INLINE GeomVertexArrayData::CData:: -CData(GeomVertexArrayData::CData &&from) NOEXCEPT : +CData(GeomVertexArrayData::CData &&from) noexcept : _usage_hint(move(from._usage_hint)), _buffer(move(from._buffer)), _modified(move(from._modified)), diff --git a/panda/src/gobj/geomVertexArrayData.h b/panda/src/gobj/geomVertexArrayData.h index 4a49d26881..7047358adc 100644 --- a/panda/src/gobj/geomVertexArrayData.h +++ b/panda/src/gobj/geomVertexArrayData.h @@ -151,7 +151,7 @@ private: class EXPCL_PANDA_GOBJ CData : public CycleData { public: INLINE CData(UsageHint usage_hint = UH_unspecified); - INLINE CData(CData &&from) NOEXCEPT; + INLINE CData(CData &&from) noexcept; INLINE CData(const CData ©); INLINE void operator = (const CData ©); diff --git a/panda/src/gobj/geomVertexArrayFormat.cxx b/panda/src/gobj/geomVertexArrayFormat.cxx index 20568fa1a3..c8adfa81eb 100644 --- a/panda/src/gobj/geomVertexArrayFormat.cxx +++ b/panda/src/gobj/geomVertexArrayFormat.cxx @@ -52,7 +52,7 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, _divisor(0), _columns_unsorted(false) { - add_column(MOVE(name0), num_components0, numeric_type0, contents0); + add_column(move(name0), num_components0, numeric_type0, contents0); } /** @@ -72,8 +72,8 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, _divisor(0), _columns_unsorted(false) { - add_column(MOVE(name0), num_components0, numeric_type0, contents0); - add_column(MOVE(name1), num_components1, numeric_type1, contents1); + add_column(move(name0), num_components0, numeric_type0, contents0); + add_column(move(name1), num_components1, numeric_type1, contents1); } /** @@ -96,9 +96,9 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, _divisor(0), _columns_unsorted(false) { - add_column(MOVE(name0), num_components0, numeric_type0, contents0); - add_column(MOVE(name1), num_components1, numeric_type1, contents1); - add_column(MOVE(name2), num_components2, numeric_type2, contents2); + add_column(move(name0), num_components0, numeric_type0, contents0); + add_column(move(name1), num_components1, numeric_type1, contents1); + add_column(move(name2), num_components2, numeric_type2, contents2); } /** @@ -124,10 +124,10 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, _divisor(0), _columns_unsorted(false) { - add_column(MOVE(name0), num_components0, numeric_type0, contents0); - add_column(MOVE(name1), num_components1, numeric_type1, contents1); - add_column(MOVE(name2), num_components2, numeric_type2, contents2); - add_column(MOVE(name3), num_components3, numeric_type3, contents3); + add_column(move(name0), num_components0, numeric_type0, contents0); + add_column(move(name1), num_components1, numeric_type1, contents1); + add_column(move(name2), num_components2, numeric_type2, contents2); + add_column(move(name3), num_components3, numeric_type3, contents3); } /** @@ -219,7 +219,7 @@ add_column(CPT_InternalName name, int num_components, start = _total_bytes; } - return add_column(GeomVertexColumn(MOVE(name), num_components, numeric_type, contents, + return add_column(GeomVertexColumn(move(name), num_components, numeric_type, contents, start, column_alignment)); } diff --git a/panda/src/gobj/geomVertexArrayFormat.h b/panda/src/gobj/geomVertexArrayFormat.h index 3b8ca3a221..fbd697fe3a 100644 --- a/panda/src/gobj/geomVertexArrayFormat.h +++ b/panda/src/gobj/geomVertexArrayFormat.h @@ -44,7 +44,7 @@ class BamReader; * "normal", "texcoord", and "color"; other kinds of data may be piggybacked * into the data record simply by choosing a unique name. */ -class EXPCL_PANDA_GOBJ GeomVertexArrayFormat FINAL : public TypedWritableReferenceCount, public GeomEnums { +class EXPCL_PANDA_GOBJ GeomVertexArrayFormat final : public TypedWritableReferenceCount, public GeomEnums { PUBLISHED: GeomVertexArrayFormat(); GeomVertexArrayFormat(const GeomVertexArrayFormat ©); diff --git a/panda/src/gobj/geomVertexColumn.I b/panda/src/gobj/geomVertexColumn.I index 4d6c5c3b68..262c19c3a2 100644 --- a/panda/src/gobj/geomVertexColumn.I +++ b/panda/src/gobj/geomVertexColumn.I @@ -28,7 +28,7 @@ GeomVertexColumn(CPT_InternalName name, int num_components, NumericType numeric_type, Contents contents, int start, int column_alignment, int num_elements, int element_stride) : - _name(MOVE(name)), + _name(std::move(name)), _num_components(num_components), _numeric_type(numeric_type), _contents(contents), diff --git a/panda/src/gobj/geomVertexColumn.h b/panda/src/gobj/geomVertexColumn.h index 5e8df9821e..6e31233946 100644 --- a/panda/src/gobj/geomVertexColumn.h +++ b/panda/src/gobj/geomVertexColumn.h @@ -342,7 +342,7 @@ private: } }; - class Packer_nativedouble_3 FINAL : public Packer_float64_3 { + class Packer_nativedouble_3 final : public Packer_float64_3 { public: virtual const LVecBase3d &get_data3d(const unsigned char *pointer); @@ -351,7 +351,7 @@ private: } }; - class Packer_point_nativedouble_2 FINAL : public Packer_point_float64_2 { + class Packer_point_nativedouble_2 final : public Packer_point_float64_2 { public: virtual const LVecBase2d &get_data2d(const unsigned char *pointer); @@ -360,7 +360,7 @@ private: } }; - class Packer_point_nativedouble_3 FINAL : public Packer_point_float64_3 { + class Packer_point_nativedouble_3 final : public Packer_point_float64_3 { public: virtual const LVecBase3d &get_data3d(const unsigned char *pointer); @@ -378,7 +378,7 @@ private: } }; - class Packer_argb_packed FINAL : public Packer_color { + class Packer_argb_packed final : public Packer_color { public: virtual const LVecBase4f &get_data4f(const unsigned char *pointer); virtual void set_data4f(unsigned char *pointer, const LVecBase4f &value); @@ -388,7 +388,7 @@ private: } }; - class Packer_rgba_uint8_4 FINAL : public Packer_color { + class Packer_rgba_uint8_4 final : public Packer_color { public: virtual const LVecBase4f &get_data4f(const unsigned char *pointer); virtual void set_data4f(unsigned char *pointer, const LVecBase4f &value); @@ -408,7 +408,7 @@ private: } }; - class Packer_rgba_nativefloat_4 FINAL : public Packer_rgba_float32_4 { + class Packer_rgba_nativefloat_4 final : public Packer_rgba_float32_4 { public: virtual const LVecBase4f &get_data4f(const unsigned char *pointer); @@ -417,7 +417,7 @@ private: } }; - class Packer_uint16_1 FINAL : public Packer { + class Packer_uint16_1 final : public Packer { public: virtual int get_data1i(const unsigned char *pointer); virtual void set_data1i(unsigned char *pointer, int value); diff --git a/panda/src/gobj/geomVertexData.I b/panda/src/gobj/geomVertexData.I index 5a24b166a5..849a3548f3 100644 --- a/panda/src/gobj/geomVertexData.I +++ b/panda/src/gobj/geomVertexData.I @@ -519,16 +519,14 @@ CacheKey(const CacheKey ©) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE GeomVertexData::CacheKey:: -CacheKey(CacheKey &&from) NOEXCEPT : - _modifier(move(from._modifier)) +CacheKey(CacheKey &&from) noexcept : + _modifier(std::move(from._modifier)) { } -#endif // USE_MOVE_SEMANTICS /** * Provides a unique ordering within the set. @@ -558,17 +556,15 @@ CacheEntry(GeomVertexData *source, const CacheKey &key) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE GeomVertexData::CacheEntry:: -CacheEntry(GeomVertexData *source, CacheKey &&key) NOEXCEPT : +CacheEntry(GeomVertexData *source, CacheKey &&key) noexcept : _source(source), - _key(move(key)) + _key(std::move(key)) { } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index 7d8e0e63f3..05992e5378 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -760,12 +760,9 @@ convert_to(const GeomVertexFormat *new_format) const { // Record the new result in the cache. if (entry == (CacheEntry *)NULL) { // Create a new entry for the result. -#ifdef USE_MOVE_SEMANTICS // We don't need the key anymore, move the pointers into the CacheEntry. entry = new CacheEntry((GeomVertexData *)this, move(key)); -#else - entry = new CacheEntry((GeomVertexData *)this, key); -#endif + { LightMutexHolder holder(_cache_lock); bool inserted = ((GeomVertexData *)this)->_cache.insert(Cache::value_type(&entry->_key, entry)).second; diff --git a/panda/src/gobj/geomVertexData.h b/panda/src/gobj/geomVertexData.h index d86dd36fc4..2a7db8115b 100644 --- a/panda/src/gobj/geomVertexData.h +++ b/panda/src/gobj/geomVertexData.h @@ -246,9 +246,7 @@ public: public: INLINE CacheKey(const GeomVertexFormat *modifier); INLINE CacheKey(const CacheKey ©); -#ifdef USE_MOVE_SEMANTICS - INLINE CacheKey(CacheKey &&from) NOEXCEPT; -#endif + INLINE CacheKey(CacheKey &&from) noexcept; INLINE bool operator < (const CacheKey &other) const; @@ -260,9 +258,8 @@ public: INLINE CacheEntry(GeomVertexData *source, const GeomVertexFormat *modifier); INLINE CacheEntry(GeomVertexData *source, const CacheKey &key); -#ifdef USE_MOVE_SEMANTICS - INLINE CacheEntry(GeomVertexData *source, CacheKey &&key) NOEXCEPT; -#endif + INLINE CacheEntry(GeomVertexData *source, CacheKey &&key) noexcept; + ALLOC_DELETED_CHAIN(CacheEntry); virtual void evict_callback(); @@ -410,14 +407,12 @@ protected: Thread *current_thread, GeomVertexData::CData *cdata); -private: - GeomVertexDataPipelineBase(const GeomVertexDataPipelineBase ©) DELETED; - GeomVertexDataPipelineBase &operator = (const GeomVertexDataPipelineBase ©) DELETED_ASSIGN; - public: + GeomVertexDataPipelineBase(const GeomVertexDataPipelineBase ©) = delete; INLINE ~GeomVertexDataPipelineBase(); -public: + GeomVertexDataPipelineBase &operator = (const GeomVertexDataPipelineBase ©) = delete; + INLINE Thread *get_current_thread() const; INLINE const GeomVertexFormat *get_format() const; diff --git a/panda/src/gobj/geomVertexFormat.h b/panda/src/gobj/geomVertexFormat.h index aa2ef4606a..6e4f668436 100644 --- a/panda/src/gobj/geomVertexFormat.h +++ b/panda/src/gobj/geomVertexFormat.h @@ -52,7 +52,7 @@ class GeomMunger; * standard and/or user-defined columns in your custom GeomVertexFormat * constructions. */ -class EXPCL_PANDA_GOBJ GeomVertexFormat FINAL : public TypedWritableReferenceCount, public GeomEnums { +class EXPCL_PANDA_GOBJ GeomVertexFormat final : public TypedWritableReferenceCount, public GeomEnums { PUBLISHED: GeomVertexFormat(); GeomVertexFormat(const GeomVertexArrayFormat *array_format); diff --git a/panda/src/gobj/geomVertexReader.I b/panda/src/gobj/geomVertexReader.I index 810f7e8f33..412bfa611d 100644 --- a/panda/src/gobj/geomVertexReader.I +++ b/panda/src/gobj/geomVertexReader.I @@ -50,7 +50,7 @@ GeomVertexReader(const GeomVertexData *vertex_data, _current_thread(current_thread) { initialize(); - set_column(MOVE(name)); + set_column(std::move(name)); } /** diff --git a/panda/src/gobj/geomVertexRewriter.I b/panda/src/gobj/geomVertexRewriter.I index 933c545885..ac092d6979 100644 --- a/panda/src/gobj/geomVertexRewriter.I +++ b/panda/src/gobj/geomVertexRewriter.I @@ -45,7 +45,7 @@ GeomVertexRewriter(GeomVertexData *vertex_data, CPT_InternalName name, GeomVertexWriter(vertex_data, current_thread), GeomVertexReader(vertex_data, current_thread) { - set_column(MOVE(name)); + set_column(std::move(name)); } /** @@ -184,7 +184,7 @@ set_column(CPT_InternalName name) { // It's important to invoke the writer first, then the reader. See // set_row(). GeomVertexWriter::set_column(name); - return GeomVertexReader::set_column(MOVE(name)); + return GeomVertexReader::set_column(std::move(name)); } /** diff --git a/panda/src/gobj/geomVertexWriter.I b/panda/src/gobj/geomVertexWriter.I index d3e1da87a3..f21280c3ad 100644 --- a/panda/src/gobj/geomVertexWriter.I +++ b/panda/src/gobj/geomVertexWriter.I @@ -48,7 +48,7 @@ GeomVertexWriter(GeomVertexData *vertex_data, CPT_InternalName name, _current_thread(current_thread) { initialize(); - set_column(MOVE(name)); + set_column(std::move(name)); } /** diff --git a/panda/src/gobj/internalName.I b/panda/src/gobj/internalName.I index 69e88c4563..d7475550e9 100644 --- a/panda/src/gobj/internalName.I +++ b/panda/src/gobj/internalName.I @@ -422,13 +422,12 @@ CPT_InternalName(const char (&literal)[N]) : { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE CPT_InternalName:: -CPT_InternalName(PointerTo &&from) NOEXCEPT : - ConstPointerTo(move(from)) +CPT_InternalName(PointerTo &&from) noexcept : + ConstPointerTo(std::move(from)) { } @@ -436,8 +435,8 @@ CPT_InternalName(PointerTo &&from) NOEXCEPT : * */ INLINE CPT_InternalName:: -CPT_InternalName(ConstPointerTo &&from) NOEXCEPT : - ConstPointerTo(move(from)) +CPT_InternalName(ConstPointerTo &&from) noexcept : + ConstPointerTo(std::move(from)) { } @@ -445,8 +444,8 @@ CPT_InternalName(ConstPointerTo &&from) NOEXCEPT : * */ INLINE CPT_InternalName &CPT_InternalName:: -operator = (PointerTo &&from) NOEXCEPT { - this->reassign(move(from)); +operator = (PointerTo &&from) noexcept { + this->reassign(std::move(from)); return *this; } @@ -454,11 +453,10 @@ operator = (PointerTo &&from) NOEXCEPT { * */ INLINE CPT_InternalName &CPT_InternalName:: -operator = (ConstPointerTo &&from) NOEXCEPT { - this->reassign(move(from)); +operator = (ConstPointerTo &&from) noexcept { + this->reassign(std::move(from)); return *this; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/gobj/internalName.h b/panda/src/gobj/internalName.h index eff928b668..7706723021 100644 --- a/panda/src/gobj/internalName.h +++ b/panda/src/gobj/internalName.h @@ -35,7 +35,7 @@ class FactoryParams; * composition of one or more other names, or by giving it a source string * directly. */ -class EXPCL_PANDA_GOBJ InternalName FINAL : public TypedWritableReferenceCount { +class EXPCL_PANDA_GOBJ InternalName final : public TypedWritableReferenceCount { private: InternalName(InternalName *parent, const string &basename); @@ -198,25 +198,22 @@ class CPT_InternalName : public ConstPointerTo { public: INLINE CPT_InternalName(const To *ptr = (const To *)NULL); INLINE CPT_InternalName(const PointerTo ©); + INLINE CPT_InternalName(PointerTo &&from) noexcept; INLINE CPT_InternalName(const ConstPointerTo ©); + INLINE CPT_InternalName(ConstPointerTo &&from) noexcept; INLINE CPT_InternalName(const string &name); template INLINE CPT_InternalName(const char (&literal)[N]); -#ifdef USE_MOVE_SEMANTICS - INLINE CPT_InternalName(PointerTo &&from) NOEXCEPT; - INLINE CPT_InternalName(ConstPointerTo &&from) NOEXCEPT; - INLINE CPT_InternalName &operator = (PointerTo &&from) NOEXCEPT; - INLINE CPT_InternalName &operator = (ConstPointerTo &&from) NOEXCEPT; -#endif // USE_MOVE_SEMANTICS - INLINE CPT_InternalName &operator = (const To *ptr); INLINE CPT_InternalName &operator = (const PointerTo ©); INLINE CPT_InternalName &operator = (const ConstPointerTo ©); + INLINE CPT_InternalName &operator = (PointerTo &&from) noexcept; + INLINE CPT_InternalName &operator = (ConstPointerTo &&from) noexcept; }; -INLINE void swap(CPT_InternalName &one, CPT_InternalName &two) NOEXCEPT { +INLINE void swap(CPT_InternalName &one, CPT_InternalName &two) noexcept { one.swap(two); } #endif // CPPPARSER diff --git a/panda/src/gobj/preparedGraphicsObjects.h b/panda/src/gobj/preparedGraphicsObjects.h index 3eaed37167..3d673b615b 100644 --- a/panda/src/gobj/preparedGraphicsObjects.h +++ b/panda/src/gobj/preparedGraphicsObjects.h @@ -164,7 +164,7 @@ public: * This is a handle to an enqueued object, from which the result can be * obtained upon completion. */ - class EXPCL_PANDA_GOBJ EnqueuedObject FINAL : public AsyncFuture { + class EXPCL_PANDA_GOBJ EnqueuedObject final : public AsyncFuture { public: EnqueuedObject(PreparedGraphicsObjects *pgo, TypedWritableReferenceCount *object); @@ -173,7 +173,7 @@ public: void set_result(SavedContext *result); void notify_removed(); - virtual bool cancel() FINAL; + virtual bool cancel() final; PUBLISHED: MAKE_PROPERTY(object, get_object); diff --git a/panda/src/gobj/shaderBuffer.h b/panda/src/gobj/shaderBuffer.h index 8d48fed425..53c110048b 100644 --- a/panda/src/gobj/shaderBuffer.h +++ b/panda/src/gobj/shaderBuffer.h @@ -29,7 +29,7 @@ class PreparedGraphicsObjects; */ class EXPCL_PANDA_GOBJ ShaderBuffer : public TypedWritableReferenceCount, public Namable, public GeomEnums { private: - INLINE ShaderBuffer() DEFAULT_CTOR; + INLINE ShaderBuffer() = default; PUBLISHED: ~ShaderBuffer(); diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index d751405a66..d48c6a7c73 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -4895,14 +4895,14 @@ do_read_ktx(CData *cdata, istream &in, const string &filename, bool header_only) } } - do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), + do_set_ram_mipmap_image(cdata, (int)n, move(image), row_size * do_get_expected_mipmap_y_size(cdata, (int)n)); } else { // Compressed image. We'll trust that the file has the right size. image = PTA_uchar::empty_array(image_size); ktx.extract_bytes(image.p(), image_size); - do_set_ram_mipmap_image(cdata, (int)n, MOVE(image), image_size / depth); + do_set_ram_mipmap_image(cdata, (int)n, move(image), image_size / depth); } ktx.skip_bytes(3 - ((image_size + 3) & 3)); diff --git a/panda/src/gobj/texture_ext.cxx b/panda/src/gobj/texture_ext.cxx index e81d40c15f..3cd291843f 100644 --- a/panda/src/gobj/texture_ext.cxx +++ b/panda/src/gobj/texture_ext.cxx @@ -77,7 +77,7 @@ set_ram_image(PyObject *image, Texture::CompressionMode compression, PTA_uchar data = PTA_uchar::empty_array(view.len, Texture::get_class_type()); memcpy(data.p(), view.buf, view.len); - _this->set_ram_image(MOVE(data), compression, page_size); + _this->set_ram_image(move(data), compression, page_size); PyBuffer_Release(&view); return; @@ -102,7 +102,7 @@ set_ram_image(PyObject *image, Texture::CompressionMode compression, PTA_uchar data = PTA_uchar::empty_array(buffer_len, Texture::get_class_type()); memcpy(data.p(), buffer, buffer_len); - _this->set_ram_image(MOVE(data), compression, page_size); + _this->set_ram_image(move(data), compression, page_size); return; } #endif @@ -155,7 +155,7 @@ set_ram_image_as(PyObject *image, const string &provided_format) { PTA_uchar data = PTA_uchar::empty_array(view.len, Texture::get_class_type()); memcpy(data.p(), view.buf, view.len); - _this->set_ram_image_as(MOVE(data), provided_format); + _this->set_ram_image_as(move(data), provided_format); PyBuffer_Release(&view); return; diff --git a/panda/src/linmath/lpoint2_src.h b/panda/src/linmath/lpoint2_src.h index 090b49d4b9..fef5c791f9 100644 --- a/panda/src/linmath/lpoint2_src.h +++ b/panda/src/linmath/lpoint2_src.h @@ -17,7 +17,7 @@ class EXPCL_PANDA_LINMATH FLOATNAME(LPoint2) : public FLOATNAME(LVecBase2) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint2)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LPoint2)() = default; INLINE_LINMATH FLOATNAME(LPoint2)(const FLOATNAME(LVecBase2)& copy); INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint2)(FLOATTYPE x, FLOATTYPE y); diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index 3465fc37d1..5089e81c9e 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -20,7 +20,7 @@ */ class EXPCL_PANDA_LINMATH FLOATNAME(LPoint3) : public FLOATNAME(LVecBase3) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint3)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LPoint3)() = default; INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) ©); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index 103c018738..1eda6fa4fe 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -16,7 +16,7 @@ */ class EXPCL_PANDA_LINMATH FLOATNAME(LPoint4) : public FLOATNAME(LVecBase4) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LPoint4)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LPoint4)() = default; INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index d0c0693f55..5d35293544 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -30,7 +30,7 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase2)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVecBase2)() = default; INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase2)(FLOATTYPE x, FLOATTYPE y); ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase2)); @@ -50,7 +50,7 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - CONSTEXPR static int size() { return 2; } + constexpr static int size() { return 2; } INLINE_LINMATH bool is_nan() const; @@ -74,7 +74,7 @@ PUBLISHED: INLINE_LINMATH void add_y(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - CONSTEXPR static int get_num_components() { return 2; } + constexpr static int get_num_components() { return 2; } public: INLINE_LINMATH iterator begin(); diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index fb9b67ca27..5def855cdd 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -30,7 +30,7 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase3)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVecBase3)() = default; INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); @@ -52,7 +52,7 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - CONSTEXPR static int size() { return 3; } + constexpr static int size() { return 3; } INLINE_LINMATH bool is_nan() const; @@ -87,7 +87,7 @@ PUBLISHED: INLINE_LINMATH void add_z(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - CONSTEXPR static int get_num_components() { return 3; } + constexpr static int get_num_components() { return 3; } public: INLINE_LINMATH iterator begin(); diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index d04201d988..b76d89a7ae 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -36,7 +36,7 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(LVecBase4)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVecBase4)() = default; INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©); @@ -62,7 +62,7 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - CONSTEXPR static int size() { return 4; } + constexpr static int size() { return 4; } INLINE_LINMATH bool is_nan() const; @@ -100,7 +100,7 @@ PUBLISHED: INLINE_LINMATH void add_w(FLOATTYPE value); INLINE_LINMATH const FLOATTYPE *get_data() const; - CONSTEXPR static int get_num_components() { return 4; } + constexpr static int get_num_components() { return 4; } INLINE_LINMATH void extract_data(float*){}; public: @@ -228,7 +228,7 @@ PUBLISHED: #endif }; - INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)() = default; INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(UnalignedLVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); @@ -238,10 +238,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); - CONSTEXPR static int size() { return 4; } + constexpr static int size() { return 4; } INLINE_LINMATH const FLOATTYPE *get_data() const; - CONSTEXPR static int get_num_components() { return 4; } + constexpr static int get_num_components() { return 4; } INLINE_LINMATH bool operator == (const FLOATNAME(UnalignedLVecBase4) &other) const; INLINE_LINMATH bool operator != (const FLOATNAME(UnalignedLVecBase4) &other) const; diff --git a/panda/src/linmath/lvector2_src.h b/panda/src/linmath/lvector2_src.h index 4a78cc7519..9b6020e00a 100644 --- a/panda/src/linmath/lvector2_src.h +++ b/panda/src/linmath/lvector2_src.h @@ -17,7 +17,7 @@ class EXPCL_PANDA_LINMATH FLOATNAME(LVector2) : public FLOATNAME(LVecBase2) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector2)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVector2)() = default; INLINE_LINMATH FLOATNAME(LVector2)(const FLOATNAME(LVecBase2)& copy); INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector2)(FLOATTYPE x, FLOATTYPE y); diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index e8f010cec7..777a064ffd 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -20,7 +20,7 @@ */ class EXPCL_PANDA_LINMATH FLOATNAME(LVector3) : public FLOATNAME(LVecBase3) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector3)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVector3)() = default; INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) ©); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index 4c576e8406..93f821b08b 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -16,7 +16,7 @@ */ class EXPCL_PANDA_LINMATH FLOATNAME(LVector4) : public FLOATNAME(LVecBase4) { PUBLISHED: - INLINE_LINMATH FLOATNAME(LVector4)() DEFAULT_CTOR; + INLINE_LINMATH FLOATNAME(LVector4)() = default; INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); diff --git a/panda/src/mathutil/geometricBoundingVolume.h b/panda/src/mathutil/geometricBoundingVolume.h index a27c19a724..a8f75a226f 100644 --- a/panda/src/mathutil/geometricBoundingVolume.h +++ b/panda/src/mathutil/geometricBoundingVolume.h @@ -51,8 +51,8 @@ PUBLISHED: virtual void xform(const LMatrix4 &mat)=0; public: - virtual GeometricBoundingVolume *as_geometric_bounding_volume() FINAL; - virtual const GeometricBoundingVolume *as_geometric_bounding_volume() const FINAL; + virtual GeometricBoundingVolume *as_geometric_bounding_volume() final; + virtual const GeometricBoundingVolume *as_geometric_bounding_volume() const final; protected: // Some virtual functions to implement fundamental bounding operations on diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index d38fc4f5a4..8c8b24f1c0 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -583,12 +583,7 @@ munge_points_to_quads(const CullTraverser *traverser, bool force) { } _geom = new_geom.p(); - -#ifdef USE_MOVE_SEMANTICS _munged_data = move(new_data); -#else - _munged_data = new_data; -#endif return true; } diff --git a/panda/src/pgraph/geomNode.I b/panda/src/pgraph/geomNode.I index 431d5e1d2e..7766631662 100644 --- a/panda/src/pgraph/geomNode.I +++ b/panda/src/pgraph/geomNode.I @@ -255,13 +255,12 @@ operator = (const GeomNode::Geoms ©) { _geoms = copy._geoms; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE GeomNode::Geoms:: -Geoms(GeomNode::Geoms &&from) NOEXCEPT : - _geoms(move(from._geoms)) +Geoms(GeomNode::Geoms &&from) noexcept : + _geoms(std::move(from._geoms)) { } @@ -269,10 +268,9 @@ Geoms(GeomNode::Geoms &&from) NOEXCEPT : * */ INLINE void GeomNode::Geoms:: -operator = (GeomNode::Geoms &&from) NOEXCEPT { - _geoms = move(from._geoms); +operator = (GeomNode::Geoms &&from) noexcept { + _geoms = std::move(from._geoms); } -#endif // USE_MOVE_SEMANTICS /** * Returns the number of geoms of the node. diff --git a/panda/src/pgraph/geomNode.h b/panda/src/pgraph/geomNode.h index d17903027a..0b5bccd492 100644 --- a/panda/src/pgraph/geomNode.h +++ b/panda/src/pgraph/geomNode.h @@ -164,12 +164,10 @@ public: INLINE Geoms(); INLINE Geoms(const CData *cdata); INLINE Geoms(const Geoms ©); - INLINE void operator = (const Geoms ©); + INLINE Geoms(Geoms &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE Geoms(Geoms &&from) NOEXCEPT; - INLINE void operator = (Geoms &&from) NOEXCEPT; -#endif + INLINE void operator = (const Geoms ©); + INLINE void operator = (Geoms &&from) noexcept; INLINE int get_num_geoms() const; INLINE CPT(Geom) get_geom(int n) const; diff --git a/panda/src/pgraph/nodePath.I b/panda/src/pgraph/nodePath.I index c7d75da2c1..8860fff331 100644 --- a/panda/src/pgraph/nodePath.I +++ b/panda/src/pgraph/nodePath.I @@ -90,12 +90,11 @@ operator = (const NodePath ©) { _error_type = copy._error_type; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE NodePath:: -NodePath(NodePath &&from) NOEXCEPT : +NodePath(NodePath &&from) noexcept : _head(move(from._head)), _backup_key(from._backup_key), _error_type(from._error_type) @@ -106,12 +105,11 @@ NodePath(NodePath &&from) NOEXCEPT : * */ INLINE void NodePath:: -operator = (NodePath &&from) NOEXCEPT { +operator = (NodePath &&from) noexcept { _head = move(from._head); _backup_key = from._backup_key; _error_type = from._error_type; } -#endif // USE_MOVE_SEMANTICS /** * Sets this NodePath to the empty NodePath. It will no longer point to any diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 41e02b0821..f8d7d6c4b0 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -5412,7 +5412,7 @@ calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, bool found_any = false; node()->calc_tight_bounds(min_point, max_point, found_any, - MOVE(transform), current_thread); + move(transform), current_thread); return found_any; } diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 11d7437113..bdd9d3f2d7 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -177,13 +177,12 @@ PUBLISHED: Thread *current_thread = Thread::get_current_thread()); INLINE NodePath(const NodePath ©); - INLINE void operator = (const NodePath ©); - INLINE void clear(); + INLINE NodePath(NodePath &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE NodePath(NodePath &&from) NOEXCEPT; - INLINE void operator = (NodePath &&from) NOEXCEPT; -#endif + INLINE void operator = (const NodePath ©); + INLINE void operator = (NodePath &&from) noexcept; + + INLINE void clear(); EXTENSION(NodePath __copy__() const); EXTENSION(PyObject *__deepcopy__(PyObject *self, PyObject *memo) const); diff --git a/panda/src/pgraph/nodePathCollection.h b/panda/src/pgraph/nodePathCollection.h index 9eb0c1ce90..7535a28718 100644 --- a/panda/src/pgraph/nodePathCollection.h +++ b/panda/src/pgraph/nodePathCollection.h @@ -25,7 +25,7 @@ */ class EXPCL_PANDA_PGRAPH NodePathCollection { PUBLISHED: - NodePathCollection() DEFAULT_CTOR; + NodePathCollection() = default; #ifdef HAVE_PYTHON EXTENSION(NodePathCollection(PyObject *self, PyObject *sequence)); diff --git a/panda/src/pgraph/nodePathComponent.h b/panda/src/pgraph/nodePathComponent.h index 2106430b7d..3752d7e834 100644 --- a/panda/src/pgraph/nodePathComponent.h +++ b/panda/src/pgraph/nodePathComponent.h @@ -39,7 +39,7 @@ * graph, and the NodePathComponents are stored in the nodes themselves to * allow the nodes to keep these up to date as the scene graph is manipulated. */ -class EXPCL_PANDA_PGRAPH NodePathComponent FINAL : public ReferenceCount { +class EXPCL_PANDA_PGRAPH NodePathComponent final : public ReferenceCount { private: NodePathComponent(PandaNode *node, NodePathComponent *next, int pipeline_stage, Thread *current_thread); diff --git a/panda/src/pgraph/pandaNode.I b/panda/src/pgraph/pandaNode.I index de6682e911..93bf19cc2d 100644 --- a/panda/src/pgraph/pandaNode.I +++ b/panda/src/pgraph/pandaNode.I @@ -929,12 +929,11 @@ operator = (const PandaNode::Children ©) { _down = copy._down; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE PandaNode::Children:: -Children(PandaNode::Children &&from) NOEXCEPT : +Children(PandaNode::Children &&from) noexcept : _down(move(from._down)) { } @@ -943,10 +942,9 @@ Children(PandaNode::Children &&from) NOEXCEPT : * */ INLINE void PandaNode::Children:: -operator = (PandaNode::Children &&from) NOEXCEPT { +operator = (PandaNode::Children &&from) noexcept { _down = move(from._down); } -#endif // USE_MOVE_SEMANTICS /** * Returns the number of children of the node. @@ -1011,13 +1009,12 @@ operator = (const PandaNode::Stashed ©) { _stashed = copy._stashed; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE PandaNode::Stashed:: -Stashed(PandaNode::Stashed &&from) NOEXCEPT : - _stashed(move(from._stashed)) +Stashed(PandaNode::Stashed &&from) noexcept : + _stashed(std::move(from._stashed)) { } @@ -1025,10 +1022,9 @@ Stashed(PandaNode::Stashed &&from) NOEXCEPT : * */ INLINE void PandaNode::Stashed:: -operator = (PandaNode::Stashed &&from) NOEXCEPT { - _stashed = move(from._stashed); +operator = (PandaNode::Stashed &&from) noexcept { + _stashed = std::move(from._stashed); } -#endif // USE_MOVE_SEMANTICS /** * Returns the number of stashed children of the node. @@ -1093,13 +1089,12 @@ operator = (const PandaNode::Parents ©) { _up = copy._up; } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE PandaNode::Parents:: -Parents(PandaNode::Parents &&from) NOEXCEPT : - _up(move(from._up)) +Parents(PandaNode::Parents &&from) noexcept : + _up(std::move(from._up)) { } @@ -1107,10 +1102,9 @@ Parents(PandaNode::Parents &&from) NOEXCEPT : * */ INLINE void PandaNode::Parents:: -operator = (PandaNode::Parents &&from) NOEXCEPT { - _up = move(from._up); +operator = (PandaNode::Parents &&from) noexcept { + _up = std::move(from._up); } -#endif // USE_MOVE_SEMANTICS /** * Returns the number of parents of the node. diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index 1b42e5ed2d..74d362113e 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -710,12 +710,10 @@ PUBLISHED: INLINE Children(); INLINE Children(const CData *cdata); INLINE Children(const Children ©); - INLINE void operator = (const Children ©); + INLINE Children(Children &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE Children(Children &&from) NOEXCEPT; - INLINE void operator = (Children &&from) NOEXCEPT; -#endif + INLINE void operator = (const Children ©); + INLINE void operator = (Children &&from) noexcept; INLINE size_t get_num_children() const; INLINE PandaNode *get_child(size_t n) const; @@ -735,12 +733,10 @@ PUBLISHED: INLINE Stashed(); INLINE Stashed(const CData *cdata); INLINE Stashed(const Stashed ©); - INLINE void operator = (const Stashed ©); + INLINE Stashed(Stashed &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE Stashed(Stashed &&from) NOEXCEPT; - INLINE void operator = (Stashed &&from) NOEXCEPT; -#endif + INLINE void operator = (const Stashed ©); + INLINE void operator = (Stashed &&from) noexcept; INLINE size_t get_num_stashed() const; INLINE PandaNode *get_stashed(size_t n) const; @@ -760,12 +756,10 @@ PUBLISHED: INLINE Parents(); INLINE Parents(const CData *cdata); INLINE Parents(const Parents ©); - INLINE void operator = (const Parents ©); + INLINE Parents(Parents &&from) noexcept; -#ifdef USE_MOVE_SEMANTICS - INLINE Parents(Parents &&from) NOEXCEPT; - INLINE void operator = (Parents &&from) NOEXCEPT; -#endif + INLINE void operator = (const Parents ©); + INLINE void operator = (Parents &&from) noexcept; INLINE size_t get_num_parents() const; INLINE PandaNode *get_parent(size_t n) const; diff --git a/panda/src/pgraph/paramNodePath.I b/panda/src/pgraph/paramNodePath.I index beaa9c5c85..89d6a9e67b 100644 --- a/panda/src/pgraph/paramNodePath.I +++ b/panda/src/pgraph/paramNodePath.I @@ -20,16 +20,14 @@ ParamNodePath(const NodePath &node_path) : { } -#ifdef USE_MOVE_SEMANTICS /** * Creates a new ParamNodePath storing the given node path object. */ INLINE ParamNodePath:: -ParamNodePath(NodePath &&node_path) NOEXCEPT : - _node_path(move(node_path)) +ParamNodePath(NodePath &&node_path) noexcept : + _node_path(std::move(node_path)) { } -#endif // USE_MOVE_SEMANTICS /** * Returns NodePath::get_class_type(). diff --git a/panda/src/pgraph/paramNodePath.h b/panda/src/pgraph/paramNodePath.h index 25812d8b0f..86f027eb99 100644 --- a/panda/src/pgraph/paramNodePath.h +++ b/panda/src/pgraph/paramNodePath.h @@ -27,10 +27,7 @@ protected: PUBLISHED: INLINE ParamNodePath(const NodePath &node_path); - -#ifdef USE_MOVE_SEMANTICS - INLINE ParamNodePath(NodePath &&node_path) NOEXCEPT; -#endif + INLINE ParamNodePath(NodePath &&node_path) noexcept; INLINE virtual TypeHandle get_value_type() const; INLINE const NodePath &get_value() const; diff --git a/panda/src/pgraph/renderAttrib.h b/panda/src/pgraph/renderAttrib.h index 5bf54cf32f..fe364d8ea4 100644 --- a/panda/src/pgraph/renderAttrib.h +++ b/panda/src/pgraph/renderAttrib.h @@ -72,7 +72,7 @@ PUBLISHED: INLINE size_t get_hash() const; INLINE CPT(RenderAttrib) get_unique() const; - virtual bool unref() const FINAL; + virtual bool unref() const final; virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level) const; diff --git a/panda/src/pgraph/renderAttribRegistry.I b/panda/src/pgraph/renderAttribRegistry.I index 1a807794a9..fab7f22d24 100644 --- a/panda/src/pgraph/renderAttribRegistry.I +++ b/panda/src/pgraph/renderAttribRegistry.I @@ -32,7 +32,7 @@ get_slot(TypeHandle type_handle) const { * * This number will not change during the lifetime of the application. */ -CONSTEXPR int RenderAttribRegistry:: +constexpr int RenderAttribRegistry:: get_max_slots() { return _max_slots; } diff --git a/panda/src/pgraph/renderAttribRegistry.h b/panda/src/pgraph/renderAttribRegistry.h index 59194fd278..ae47bd39a8 100644 --- a/panda/src/pgraph/renderAttribRegistry.h +++ b/panda/src/pgraph/renderAttribRegistry.h @@ -54,7 +54,7 @@ public: PUBLISHED: INLINE int get_slot(TypeHandle type_handle) const; - static CONSTEXPR int get_max_slots(); + static constexpr int get_max_slots(); INLINE int get_num_slots() const; INLINE TypeHandle get_slot_type(int slot) const; diff --git a/panda/src/pgraph/shaderInput.I b/panda/src/pgraph/shaderInput.I index 8c37322082..b8e182421f 100644 --- a/panda/src/pgraph/shaderInput.I +++ b/panda/src/pgraph/shaderInput.I @@ -18,7 +18,7 @@ */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_invalid), _priority(priority) { @@ -29,7 +29,7 @@ ShaderInput(CPT_InternalName name, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, Texture *tex, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_texture), _priority(priority), _value(tex) @@ -41,7 +41,7 @@ ShaderInput(CPT_InternalName name, Texture *tex, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, ParamValueBase *param, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_param), _priority(priority), _value(param) @@ -53,7 +53,7 @@ ShaderInput(CPT_InternalName name, ParamValueBase *param, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, ShaderBuffer *buf, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_buffer), _priority(priority), _value(buf) @@ -65,7 +65,7 @@ ShaderInput(CPT_InternalName name, ShaderBuffer *buf, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_float &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -77,7 +77,7 @@ ShaderInput(CPT_InternalName name, const PTA_float &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase4f &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -89,7 +89,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase4f &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase3f &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -101,7 +101,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase3f &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase2f &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -113,7 +113,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase2f &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase4f &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_vector), _priority(priority), _stored_ptr(vec), @@ -126,7 +126,7 @@ ShaderInput(CPT_InternalName name, const LVecBase4f &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase3f &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_vector), _priority(priority), _stored_ptr(vec), @@ -139,7 +139,7 @@ ShaderInput(CPT_InternalName name, const LVecBase3f &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase2f &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_vector), _priority(priority), _stored_ptr(vec), @@ -152,7 +152,7 @@ ShaderInput(CPT_InternalName name, const LVecBase2f &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LMatrix4f &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -164,7 +164,7 @@ ShaderInput(CPT_InternalName name, const PTA_LMatrix4f &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LMatrix3f &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -176,7 +176,7 @@ ShaderInput(CPT_InternalName name, const PTA_LMatrix3f &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LMatrix4f &mat, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(mat) @@ -188,7 +188,7 @@ ShaderInput(CPT_InternalName name, const LMatrix4f &mat, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LMatrix3f &mat, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(mat) @@ -200,7 +200,7 @@ ShaderInput(CPT_InternalName name, const LMatrix3f &mat, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_double &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -212,7 +212,7 @@ ShaderInput(CPT_InternalName name, const PTA_double &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase4d &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -224,7 +224,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase4d &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase3d &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -236,7 +236,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase3d &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase2d &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -248,7 +248,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase2d &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase4d &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), @@ -261,7 +261,7 @@ ShaderInput(CPT_InternalName name, const LVecBase4d &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase3d &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), @@ -274,7 +274,7 @@ ShaderInput(CPT_InternalName name, const LVecBase3d &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase2d &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), @@ -287,7 +287,7 @@ ShaderInput(CPT_InternalName name, const LVecBase2d &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LMatrix4d &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -299,7 +299,7 @@ ShaderInput(CPT_InternalName name, const PTA_LMatrix4d &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LMatrix3d &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -311,7 +311,7 @@ ShaderInput(CPT_InternalName name, const PTA_LMatrix3d &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LMatrix4d &mat, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(mat) @@ -323,7 +323,7 @@ ShaderInput(CPT_InternalName name, const LMatrix4d &mat, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LMatrix3d &mat, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(mat) @@ -335,7 +335,7 @@ ShaderInput(CPT_InternalName name, const LMatrix3d &mat, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_int &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -347,7 +347,7 @@ ShaderInput(CPT_InternalName name, const PTA_int &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase4i &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -359,7 +359,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase4i &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase3i &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -371,7 +371,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase3i &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const PTA_LVecBase2i &ptr, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(ptr) @@ -383,7 +383,7 @@ ShaderInput(CPT_InternalName name, const PTA_LVecBase2i &ptr, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase4i &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), @@ -396,7 +396,7 @@ ShaderInput(CPT_InternalName name, const LVecBase4i &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase3i &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), @@ -409,7 +409,7 @@ ShaderInput(CPT_InternalName name, const LVecBase3i &vec, int priority) : */ INLINE ShaderInput:: ShaderInput(CPT_InternalName name, const LVecBase2i &vec, int priority) : - _name(MOVE(name)), + _name(std::move(name)), _type(M_numeric), _priority(priority), _stored_ptr(vec), diff --git a/panda/src/pgraph/shaderInput.cxx b/panda/src/pgraph/shaderInput.cxx index 44fb91cf23..86a3912ec4 100644 --- a/panda/src/pgraph/shaderInput.cxx +++ b/panda/src/pgraph/shaderInput.cxx @@ -30,7 +30,7 @@ get_blank() { */ ShaderInput:: ShaderInput(CPT_InternalName name, const NodePath &np, int priority) : - _name(MOVE(name)), + _name(move(name)), _type(M_nodepath), _priority(priority), _value(new ParamNodePath(np)) @@ -42,7 +42,7 @@ ShaderInput(CPT_InternalName name, const NodePath &np, int priority) : */ ShaderInput:: ShaderInput(CPT_InternalName name, Texture *tex, bool read, bool write, int z, int n, int priority) : - _name(MOVE(name)), + _name(move(name)), _type(M_texture_image), _priority(priority), _value(new ParamTextureImage(tex, read, write, z, n)) @@ -54,7 +54,7 @@ ShaderInput(CPT_InternalName name, Texture *tex, bool read, bool write, int z, i */ ShaderInput:: ShaderInput(CPT_InternalName name, Texture *tex, const SamplerState &sampler, int priority) : - _name(MOVE(name)), + _name(move(name)), _type(M_texture_sampler), _priority(priority), _value(new ParamTextureSampler(tex, sampler)) diff --git a/panda/src/pgraph/shaderInput.h b/panda/src/pgraph/shaderInput.h index 39a4e32fe8..39ae9ba835 100644 --- a/panda/src/pgraph/shaderInput.h +++ b/panda/src/pgraph/shaderInput.h @@ -124,7 +124,7 @@ PUBLISHED: const SamplerState &get_sampler() const; public: - ShaderInput() DEFAULT_CTOR; + ShaderInput() = default; INLINE ParamValueBase *get_param() const; INLINE TypedWritableReferenceCount *get_value() const; diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index b770e7bf52..2313ea136f 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -51,7 +51,7 @@ class FactoryParams; * directly. Instead, call one of the make() functions to create one for you. * And instead of modifying a TransformState object, create a new one. */ -class EXPCL_PANDA_PGRAPH TransformState FINAL : public NodeCachedReferenceCount { +class EXPCL_PANDA_PGRAPH TransformState final : public NodeCachedReferenceCount { protected: TransformState(); diff --git a/panda/src/pgraphnodes/ambientLight.h b/panda/src/pgraphnodes/ambientLight.h index f3582e54fd..959a2d1485 100644 --- a/panda/src/pgraphnodes/ambientLight.h +++ b/panda/src/pgraphnodes/ambientLight.h @@ -33,7 +33,7 @@ protected: public: virtual PandaNode *make_copy() const; virtual void write(ostream &out, int indent_level) const; - virtual bool is_ambient_light() const FINAL; + virtual bool is_ambient_light() const final; PUBLISHED: virtual int get_class_priority() const; diff --git a/panda/src/pgraphnodes/directionalLight.h b/panda/src/pgraphnodes/directionalLight.h index df2a198273..c78f76f81e 100644 --- a/panda/src/pgraphnodes/directionalLight.h +++ b/panda/src/pgraphnodes/directionalLight.h @@ -39,7 +39,7 @@ public: const LMatrix4 &to_object_space); PUBLISHED: - INLINE const LColor &get_specular_color() const FINAL; + INLINE const LColor &get_specular_color() const final; INLINE void set_specular_color(const LColor &color); INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); diff --git a/panda/src/pgraphnodes/pointLight.h b/panda/src/pgraphnodes/pointLight.h index ba3a334d47..bb37237883 100644 --- a/panda/src/pgraphnodes/pointLight.h +++ b/panda/src/pgraphnodes/pointLight.h @@ -39,12 +39,12 @@ public: const LMatrix4 &to_object_space); PUBLISHED: - INLINE const LColor &get_specular_color() const FINAL; + INLINE const LColor &get_specular_color() const final; INLINE void set_specular_color(const LColor &color); INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); - INLINE const LVecBase3 &get_attenuation() const FINAL; + INLINE const LVecBase3 &get_attenuation() const final; INLINE void set_attenuation(const LVecBase3 &attenuation); MAKE_PROPERTY(attenuation, get_attenuation, set_attenuation); diff --git a/panda/src/pgraphnodes/rectangleLight.h b/panda/src/pgraphnodes/rectangleLight.h index 3870b4f8f7..b6a4e173c1 100644 --- a/panda/src/pgraphnodes/rectangleLight.h +++ b/panda/src/pgraphnodes/rectangleLight.h @@ -35,7 +35,7 @@ public: virtual void write(ostream &out, int indent_level) const; PUBLISHED: - INLINE const LColor &get_specular_color() const FINAL; + INLINE const LColor &get_specular_color() const final; INLINE PN_stdfloat get_max_distance() const; INLINE void set_max_distance(PN_stdfloat max_distance); diff --git a/panda/src/pgraphnodes/spotlight.h b/panda/src/pgraphnodes/spotlight.h index c9a6962b07..d1e56a88b3 100644 --- a/panda/src/pgraphnodes/spotlight.h +++ b/panda/src/pgraphnodes/spotlight.h @@ -46,16 +46,16 @@ public: const LMatrix4 &to_object_space); PUBLISHED: - INLINE PN_stdfloat get_exponent() const FINAL; + INLINE PN_stdfloat get_exponent() const final; INLINE void set_exponent(PN_stdfloat exponent); MAKE_PROPERTY(exponent, get_exponent, set_exponent); - INLINE const LColor &get_specular_color() const FINAL; + INLINE const LColor &get_specular_color() const final; INLINE void set_specular_color(const LColor &color); INLINE void clear_specular_color(); MAKE_PROPERTY(specular_color, get_specular_color, set_specular_color); - INLINE const LVecBase3 &get_attenuation() const FINAL; + INLINE const LVecBase3 &get_attenuation() const final; INLINE void set_attenuation(const LVecBase3 &attenuation); MAKE_PROPERTY(attenuation, get_attenuation, set_attenuation); diff --git a/panda/src/pipeline/cycleData.h b/panda/src/pipeline/cycleData.h index 72ba074088..44c0a7b88c 100644 --- a/panda/src/pipeline/cycleData.h +++ b/panda/src/pipeline/cycleData.h @@ -49,9 +49,9 @@ class EXPCL_PANDA_PIPELINE CycleData #endif // DO_PIPELINING { public: - INLINE CycleData() DEFAULT_CTOR; - INLINE CycleData(CycleData &&from) DEFAULT_CTOR; - INLINE CycleData(const CycleData ©) DEFAULT_CTOR; + INLINE CycleData() = default; + INLINE CycleData(CycleData &&from) = default; + INLINE CycleData(const CycleData ©) = default; virtual ~CycleData(); virtual CycleData *make_copy() const=0; diff --git a/panda/src/pipeline/cycleDataLockedReader.I b/panda/src/pipeline/cycleDataLockedReader.I index 0ac88ebb67..311314e1dd 100644 --- a/panda/src/pipeline/cycleDataLockedReader.I +++ b/panda/src/pipeline/cycleDataLockedReader.I @@ -61,13 +61,12 @@ operator = (const CycleDataLockedReader ©) { _cycler->increment_read(_pointer); } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE CycleDataLockedReader:: -CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT : +CycleDataLockedReader(CycleDataLockedReader &&from) noexcept : _cycler(from._cycler), _current_thread(from._current_thread), _pointer(from._pointer) @@ -80,7 +79,7 @@ CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT : */ template INLINE void CycleDataLockedReader:: -operator = (CycleDataLockedReader &&from) NOEXCEPT { +operator = (CycleDataLockedReader &&from) noexcept { nassertv(_pointer == (CycleDataType *)NULL); nassertv(_current_thread == from._current_thread); @@ -89,7 +88,6 @@ operator = (CycleDataLockedReader &&from) NOEXCEPT { from._pointer = NULL; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/pipeline/cycleDataLockedReader.h b/panda/src/pipeline/cycleDataLockedReader.h index f66143fab4..62c1a72b1a 100644 --- a/panda/src/pipeline/cycleDataLockedReader.h +++ b/panda/src/pipeline/cycleDataLockedReader.h @@ -45,12 +45,10 @@ public: INLINE CycleDataLockedReader(const PipelineCycler &cycler, Thread *current_thread = Thread::get_current_thread()); INLINE CycleDataLockedReader(const CycleDataLockedReader ©); - INLINE void operator = (const CycleDataLockedReader ©); + INLINE CycleDataLockedReader(CycleDataLockedReader &&from) noexcept; -#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) - INLINE CycleDataLockedReader(CycleDataLockedReader &&from) NOEXCEPT; - INLINE void operator = (CycleDataLockedReader &&from) NOEXCEPT; -#endif + INLINE void operator = (const CycleDataLockedReader ©); + INLINE void operator = (CycleDataLockedReader &&from) noexcept; INLINE ~CycleDataLockedReader(); diff --git a/panda/src/pipeline/cycleDataLockedStageReader.I b/panda/src/pipeline/cycleDataLockedStageReader.I index 9f2c74d23a..d65d9da889 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.I +++ b/panda/src/pipeline/cycleDataLockedStageReader.I @@ -64,13 +64,12 @@ operator = (const CycleDataLockedStageReader ©) { _cycler->increment_read(_pointer); } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE CycleDataLockedStageReader:: -CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT : +CycleDataLockedStageReader(CycleDataLockedStageReader &&from) noexcept : _cycler(from._cycler), _current_thread(from._current_thread), _pointer(from._pointer), @@ -84,7 +83,7 @@ CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOE */ template INLINE void CycleDataLockedStageReader:: -operator = (CycleDataLockedStageReader &&from) NOEXCEPT { +operator = (CycleDataLockedStageReader &&from) noexcept { nassertv(_pointer == (CycleDataType *)NULL); nassertv(_current_thread == from._current_thread); @@ -94,7 +93,6 @@ operator = (CycleDataLockedStageReader &&from) NOEXCEPT { from._pointer = NULL; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/pipeline/cycleDataLockedStageReader.h b/panda/src/pipeline/cycleDataLockedStageReader.h index 6837a6edf4..4220a2ce0f 100644 --- a/panda/src/pipeline/cycleDataLockedStageReader.h +++ b/panda/src/pipeline/cycleDataLockedStageReader.h @@ -32,12 +32,10 @@ public: INLINE CycleDataLockedStageReader(const PipelineCycler &cycler, int stage, Thread *current_thread = Thread::get_current_thread()); INLINE CycleDataLockedStageReader(const CycleDataLockedStageReader ©); - INLINE void operator = (const CycleDataLockedStageReader ©); + INLINE CycleDataLockedStageReader(CycleDataLockedStageReader &&from) noexcept; -#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) - INLINE CycleDataLockedStageReader(CycleDataLockedStageReader &&from) NOEXCEPT; - INLINE void operator = (CycleDataLockedStageReader &&from) NOEXCEPT; -#endif + INLINE void operator = (const CycleDataLockedStageReader ©); + INLINE void operator = (CycleDataLockedStageReader &&from) noexcept; INLINE ~CycleDataLockedStageReader(); diff --git a/panda/src/pipeline/cycleDataStageWriter.I b/panda/src/pipeline/cycleDataStageWriter.I index 3e6d464768..a4ccc54c60 100644 --- a/panda/src/pipeline/cycleDataStageWriter.I +++ b/panda/src/pipeline/cycleDataStageWriter.I @@ -114,13 +114,12 @@ CycleDataStageWriter(PipelineCycler &cycler, int stage, force_to_0, _current_thread); } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE CycleDataStageWriter:: -CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT : +CycleDataStageWriter(CycleDataStageWriter &&from) noexcept : _cycler(from._cycler), _current_thread(from._current_thread), _pointer(from._pointer), @@ -134,7 +133,7 @@ CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT : */ template INLINE void CycleDataStageWriter:: -operator = (CycleDataStageWriter &&from) NOEXCEPT { +operator = (CycleDataStageWriter &&from) noexcept { nassertv(_pointer == (CycleDataType *)NULL); nassertv(_current_thread == from._current_thread); @@ -144,7 +143,6 @@ operator = (CycleDataStageWriter &&from) NOEXCEPT { from._pointer = NULL; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/pipeline/cycleDataStageWriter.h b/panda/src/pipeline/cycleDataStageWriter.h index d154adb6d8..0357d1863d 100644 --- a/panda/src/pipeline/cycleDataStageWriter.h +++ b/panda/src/pipeline/cycleDataStageWriter.h @@ -39,7 +39,7 @@ public: bool force_to_0, Thread *current_thread = Thread::get_current_thread()); INLINE CycleDataStageWriter(const CycleDataStageWriter ©); - INLINE void operator = (const CycleDataStageWriter ©); + INLINE CycleDataStageWriter(CycleDataStageWriter &&from) noexcept; INLINE CycleDataStageWriter(PipelineCycler &cycler, int stage, CycleDataLockedStageReader &take_from); @@ -47,13 +47,11 @@ public: CycleDataLockedStageReader &take_from, bool force_to_0); -#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) - INLINE CycleDataStageWriter(CycleDataStageWriter &&from) NOEXCEPT; - INLINE void operator = (CycleDataStageWriter &&from) NOEXCEPT; -#endif - INLINE ~CycleDataStageWriter(); + INLINE void operator = (const CycleDataStageWriter ©); + INLINE void operator = (CycleDataStageWriter &&from) noexcept; + INLINE CycleDataType *operator -> (); INLINE const CycleDataType *operator -> () const; diff --git a/panda/src/pipeline/cycleDataWriter.I b/panda/src/pipeline/cycleDataWriter.I index 3706468612..e142c38b3a 100644 --- a/panda/src/pipeline/cycleDataWriter.I +++ b/panda/src/pipeline/cycleDataWriter.I @@ -130,13 +130,12 @@ CycleDataWriter(PipelineCycler &cycler, force_to_0, _current_thread); } -#ifdef USE_MOVE_SEMANTICS /** * */ template INLINE CycleDataWriter:: -CycleDataWriter(CycleDataWriter &&from) NOEXCEPT : +CycleDataWriter(CycleDataWriter &&from) noexcept : _cycler(from._cycler), _current_thread(from._current_thread), _pointer(from._pointer) @@ -149,7 +148,7 @@ CycleDataWriter(CycleDataWriter &&from) NOEXCEPT : */ template INLINE void CycleDataWriter:: -operator = (CycleDataWriter &&from) NOEXCEPT { +operator = (CycleDataWriter &&from) noexcept { nassertv(_pointer == (CycleDataType *)NULL); nassertv(_current_thread == from._current_thread); @@ -158,7 +157,6 @@ operator = (CycleDataWriter &&from) NOEXCEPT { from._pointer = NULL; } -#endif // USE_MOVE_SEMANTICS /** * diff --git a/panda/src/pipeline/cycleDataWriter.h b/panda/src/pipeline/cycleDataWriter.h index e2a4da7831..616ddae28e 100644 --- a/panda/src/pipeline/cycleDataWriter.h +++ b/panda/src/pipeline/cycleDataWriter.h @@ -44,15 +44,13 @@ public: CycleDataType *locked_cdata, Thread *current_thread = Thread::get_current_thread()); INLINE CycleDataWriter(const CycleDataWriter ©); - INLINE void operator = (const CycleDataWriter ©); + INLINE CycleDataWriter(CycleDataWriter &&from) noexcept; INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from); INLINE CycleDataWriter(PipelineCycler &cycler, CycleDataLockedReader &take_from, bool force_to_0); -#if defined(USE_MOVE_SEMANTICS) && defined(DO_PIPELINING) - INLINE CycleDataWriter(CycleDataWriter &&from) NOEXCEPT; - INLINE void operator = (CycleDataWriter &&from) NOEXCEPT; -#endif + INLINE void operator = (CycleDataWriter &&from) noexcept; + INLINE void operator = (const CycleDataWriter ©); INLINE ~CycleDataWriter(); diff --git a/panda/src/pipeline/lightMutex.I b/panda/src/pipeline/lightMutex.I index a7bb09ed17..4121d607e2 100644 --- a/panda/src/pipeline/lightMutex.I +++ b/panda/src/pipeline/lightMutex.I @@ -46,31 +46,3 @@ LightMutex(const string &) #endif // DEBUG_THREADS { } - -/** - * - */ -INLINE LightMutex:: -~LightMutex() { -} - -/** - * Do not attempt to copy lightMutexes. - */ -INLINE LightMutex:: -#ifdef DEBUG_THREADS -LightMutex(const LightMutex ©) : MutexDebug(string(), false, true) -#else - LightMutex(const LightMutex ©) -#endif // DEBUG_THREADS -{ - nassertv(false); -} - -/** - * Do not attempt to copy lightMutexes. - */ -INLINE void LightMutex:: -operator = (const LightMutex ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/lightMutex.h b/panda/src/pipeline/lightMutex.h index 77ad4b26ae..164db7195e 100644 --- a/panda/src/pipeline/lightMutex.h +++ b/panda/src/pipeline/lightMutex.h @@ -45,10 +45,10 @@ public: INLINE explicit LightMutex(const char *name); PUBLISHED: INLINE explicit LightMutex(const string &name); - INLINE ~LightMutex(); -private: - INLINE LightMutex(const LightMutex ©); - INLINE void operator = (const LightMutex ©); + LightMutex(const LightMutex ©) = delete; + ~LightMutex() = default; + + void operator = (const LightMutex ©) = delete; }; #include "lightMutex.I" diff --git a/panda/src/pipeline/lightMutexDirect.I b/panda/src/pipeline/lightMutexDirect.I index e9d838d3fb..041f388ce2 100644 --- a/panda/src/pipeline/lightMutexDirect.I +++ b/panda/src/pipeline/lightMutexDirect.I @@ -11,36 +11,6 @@ * @date 2008-10-08 */ -/** - * - */ -INLINE LightMutexDirect:: -LightMutexDirect() { -} - -/** - * - */ -INLINE LightMutexDirect:: -~LightMutexDirect() { -} - -/** - * Do not attempt to copy lightMutexes. - */ -INLINE LightMutexDirect:: -LightMutexDirect(const LightMutexDirect ©) { - nassertv(false); -} - -/** - * Do not attempt to copy lightMutexes. - */ -INLINE void LightMutexDirect:: -operator = (const LightMutexDirect ©) { - nassertv(false); -} - /** * Alias for acquire() to match C++11 semantics. * @see acquire() diff --git a/panda/src/pipeline/lightMutexDirect.h b/panda/src/pipeline/lightMutexDirect.h index 54fca1a0ee..78ffcce433 100644 --- a/panda/src/pipeline/lightMutexDirect.h +++ b/panda/src/pipeline/lightMutexDirect.h @@ -30,11 +30,11 @@ class Thread; */ class EXPCL_PANDA_PIPELINE LightMutexDirect { protected: - INLINE LightMutexDirect(); - INLINE ~LightMutexDirect(); -private: - INLINE LightMutexDirect(const LightMutexDirect ©); - INLINE void operator = (const LightMutexDirect ©); + LightMutexDirect() = default; + LightMutexDirect(const LightMutexDirect ©) = delete; + ~LightMutexDirect() = default; + + void operator = (const LightMutexDirect ©) = delete; public: INLINE void lock(); diff --git a/panda/src/pipeline/lightReMutexDirect.I b/panda/src/pipeline/lightReMutexDirect.I index 1cfbe15723..388387517c 100644 --- a/panda/src/pipeline/lightReMutexDirect.I +++ b/panda/src/pipeline/lightReMutexDirect.I @@ -26,33 +26,6 @@ LightReMutexDirect() #endif } -/** - * - */ -INLINE LightReMutexDirect:: -~LightReMutexDirect() { -} - -/** - * Do not attempt to copy lightReMutexes. - */ -INLINE LightReMutexDirect:: -LightReMutexDirect(const LightReMutexDirect ©) -#ifndef HAVE_REMUTEXIMPL - : _cvar_impl(_lock_impl) -#endif -{ - nassertv(false); -} - -/** - * Do not attempt to copy lightReMutexes. - */ -INLINE void LightReMutexDirect:: -operator = (const LightReMutexDirect ©) { - nassertv(false); -} - /** * Alias for acquire() to match C++11 semantics. * @see acquire() diff --git a/panda/src/pipeline/lightReMutexDirect.h b/panda/src/pipeline/lightReMutexDirect.h index 7976b90e2c..21f25c1c31 100644 --- a/panda/src/pipeline/lightReMutexDirect.h +++ b/panda/src/pipeline/lightReMutexDirect.h @@ -30,10 +30,10 @@ class Thread; class EXPCL_PANDA_PIPELINE LightReMutexDirect { protected: INLINE LightReMutexDirect(); - INLINE ~LightReMutexDirect(); -private: - INLINE LightReMutexDirect(const LightReMutexDirect ©); - INLINE void operator = (const LightReMutexDirect ©); + LightReMutexDirect(const LightReMutexDirect ©) = delete; + ~LightReMutexDirect() = default; + + void operator = (const LightReMutexDirect ©) = delete; public: INLINE void lock(); diff --git a/panda/src/pipeline/mutexDebug.I b/panda/src/pipeline/mutexDebug.I index 724078b033..9262f3e6d3 100644 --- a/panda/src/pipeline/mutexDebug.I +++ b/panda/src/pipeline/mutexDebug.I @@ -11,22 +11,6 @@ * @date 2006-02-13 */ -/** - * Do not attempt to copy mutexes. - */ -INLINE MutexDebug:: -MutexDebug(const MutexDebug ©) : _cvar_impl(*get_global_lock()) { - nassertv(false); -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE void MutexDebug:: -operator = (const MutexDebug ©) { - nassertv(false); -} - /** * Alias for acquire() to match C++11 semantics. * @see acquire() diff --git a/panda/src/pipeline/mutexDebug.h b/panda/src/pipeline/mutexDebug.h index 2ced4beca0..4fc3e4eeaa 100644 --- a/panda/src/pipeline/mutexDebug.h +++ b/panda/src/pipeline/mutexDebug.h @@ -30,10 +30,10 @@ class EXPCL_PANDA_PIPELINE MutexDebug : public Namable { protected: MutexDebug(const string &name, bool allow_recursion, bool lightweight); + MutexDebug(const MutexDebug ©) = delete; virtual ~MutexDebug(); -private: - INLINE MutexDebug(const MutexDebug ©); - INLINE void operator = (const MutexDebug ©); + + void operator = (const MutexDebug ©) = delete; public: INLINE void lock(); diff --git a/panda/src/pipeline/mutexDirect.I b/panda/src/pipeline/mutexDirect.I index 73cde8b33b..e12442289c 100644 --- a/panda/src/pipeline/mutexDirect.I +++ b/panda/src/pipeline/mutexDirect.I @@ -11,36 +11,6 @@ * @date 2006-02-13 */ -/** - * - */ -INLINE MutexDirect:: -MutexDirect() { -} - -/** - * - */ -INLINE MutexDirect:: -~MutexDirect() { -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE MutexDirect:: -MutexDirect(const MutexDirect ©) { - nassertv(false); -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE void MutexDirect:: -operator = (const MutexDirect ©) { - nassertv(false); -} - /** * Alias for acquire() to match C++11 semantics. * @see acquire() diff --git a/panda/src/pipeline/mutexDirect.h b/panda/src/pipeline/mutexDirect.h index 6f888e0af6..b288dc0648 100644 --- a/panda/src/pipeline/mutexDirect.h +++ b/panda/src/pipeline/mutexDirect.h @@ -29,11 +29,11 @@ class Thread; */ class EXPCL_PANDA_PIPELINE MutexDirect { protected: - INLINE MutexDirect(); - INLINE ~MutexDirect(); -private: - INLINE MutexDirect(const MutexDirect ©); - INLINE void operator = (const MutexDirect ©); + MutexDirect() = default; + MutexDirect(const MutexDirect ©) = delete; + ~MutexDirect() = default; + + void operator = (const MutexDirect ©) = delete; public: INLINE void lock(); diff --git a/panda/src/pipeline/mutexSimpleImpl.h b/panda/src/pipeline/mutexSimpleImpl.h index 31a50c306c..3c194a08f1 100644 --- a/panda/src/pipeline/mutexSimpleImpl.h +++ b/panda/src/pipeline/mutexSimpleImpl.h @@ -36,7 +36,7 @@ */ class EXPCL_PANDA_PIPELINE MutexSimpleImpl : public BlockerSimple { public: - CONSTEXPR MutexSimpleImpl() DEFAULT_CTOR; + constexpr MutexSimpleImpl() = default; INLINE void lock(); INLINE bool try_lock(); diff --git a/panda/src/pipeline/pmutex.I b/panda/src/pipeline/pmutex.I index 1cdfd011d4..9a5ca4c926 100644 --- a/panda/src/pipeline/pmutex.I +++ b/panda/src/pipeline/pmutex.I @@ -46,31 +46,3 @@ Mutex(const string &) #endif // DEBUG_THREADS { } - -/** - * - */ -INLINE Mutex:: -~Mutex() { -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE Mutex:: -#ifdef DEBUG_THREADS -Mutex(const Mutex ©) : MutexDebug(string(), false, false) -#else - Mutex(const Mutex ©) -#endif // DEBUG_THREADS -{ - nassertv(false); -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE void Mutex:: -operator = (const Mutex ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/pmutex.h b/panda/src/pipeline/pmutex.h index c5d471ae0c..bc547afab3 100644 --- a/panda/src/pipeline/pmutex.h +++ b/panda/src/pipeline/pmutex.h @@ -44,10 +44,10 @@ public: INLINE Mutex(const char *name); PUBLISHED: INLINE explicit Mutex(const string &name); - INLINE ~Mutex(); -private: - INLINE Mutex(const Mutex ©); - INLINE void operator = (const Mutex ©); + Mutex(const Mutex ©) = delete; + ~Mutex() = default; + + void operator = (const Mutex ©) = delete; public: // This is a global mutex set aside for the purpose of protecting Notify diff --git a/panda/src/pipeline/reMutex.I b/panda/src/pipeline/reMutex.I index e67f378c35..361d3a1c85 100644 --- a/panda/src/pipeline/reMutex.I +++ b/panda/src/pipeline/reMutex.I @@ -46,18 +46,3 @@ ReMutex(const string &) #endif // DEBUG_THREADS { } - -/** - * - */ -INLINE ReMutex:: -~ReMutex() { -} - -/** - * Do not attempt to copy mutexes. - */ -INLINE void ReMutex:: -operator = (const ReMutex ©) { - nassertv(false); -} diff --git a/panda/src/pipeline/reMutex.h b/panda/src/pipeline/reMutex.h index fd6a710b55..1597c2d7c4 100644 --- a/panda/src/pipeline/reMutex.h +++ b/panda/src/pipeline/reMutex.h @@ -38,10 +38,10 @@ public: INLINE explicit ReMutex(const char *name); PUBLISHED: INLINE explicit ReMutex(const string &name); - INLINE ~ReMutex(); -private: - INLINE ReMutex(const ReMutex ©); - INLINE void operator = (const ReMutex ©); + ReMutex(const ReMutex ©) = delete; + ~ReMutex() = default; + + void operator = (const ReMutex ©) = delete; }; #include "reMutex.I" diff --git a/panda/src/pipeline/reMutexDirect.I b/panda/src/pipeline/reMutexDirect.I index 7d0319ad61..cdcc7fd45e 100644 --- a/panda/src/pipeline/reMutexDirect.I +++ b/panda/src/pipeline/reMutexDirect.I @@ -26,33 +26,6 @@ ReMutexDirect() #endif } -/** - * - */ -INLINE ReMutexDirect:: -~ReMutexDirect() { -} - -/** - * Do not attempt to copy reMutexes. - */ -INLINE ReMutexDirect:: -ReMutexDirect(const ReMutexDirect ©) -#ifndef HAVE_REMUTEXTRUEIMPL - : _cvar_impl(_lock_impl) -#endif -{ - nassertv(false); -} - -/** - * Do not attempt to copy reMutexes. - */ -INLINE void ReMutexDirect:: -operator = (const ReMutexDirect ©) { - nassertv(false); -} - /** * Alias for acquire() to match C++11 semantics. * @see acquire() diff --git a/panda/src/pipeline/reMutexDirect.h b/panda/src/pipeline/reMutexDirect.h index fd18a38fc2..c47c4b02bd 100644 --- a/panda/src/pipeline/reMutexDirect.h +++ b/panda/src/pipeline/reMutexDirect.h @@ -30,10 +30,10 @@ class Thread; class EXPCL_PANDA_PIPELINE ReMutexDirect { protected: INLINE ReMutexDirect(); - INLINE ~ReMutexDirect(); -private: - INLINE ReMutexDirect(const ReMutexDirect ©); - INLINE void operator = (const ReMutexDirect ©); + ReMutexDirect(const ReMutexDirect ©) = delete; + ~ReMutexDirect() = default; + + void operator = (const ReMutexDirect ©) = delete; public: INLINE void lock(); diff --git a/panda/src/putil/bitArray.I b/panda/src/putil/bitArray.I index f746a9ba77..2a3341833d 100644 --- a/panda/src/putil/bitArray.I +++ b/panda/src/putil/bitArray.I @@ -87,7 +87,7 @@ range(int low_bit, int size) { * bits. This method is defined so generic programming algorithms can use * BitMask or BitArray interchangeably. */ -CONSTEXPR bool BitArray:: +constexpr bool BitArray:: has_max_num_bits() { return false; } @@ -101,7 +101,7 @@ has_max_num_bits() { * number of bits. This method is defined so generic programming algorithms * can use BitMask or BitArray interchangeably. */ -CONSTEXPR int BitArray:: +constexpr int BitArray:: get_max_num_bits() { return INT_MAX; } @@ -111,7 +111,7 @@ get_max_num_bits() { * only in that it limits the maximum number of bits that may be queried or * set at once by extract() and store(). */ -CONSTEXPR int BitArray:: +constexpr int BitArray:: get_num_bits_per_word() { return num_bits_per_word; } diff --git a/panda/src/putil/bitArray.h b/panda/src/putil/bitArray.h index 72ef1f656d..42070ad3f8 100644 --- a/panda/src/putil/bitArray.h +++ b/panda/src/putil/bitArray.h @@ -54,10 +54,10 @@ PUBLISHED: INLINE static BitArray bit(int index); INLINE static BitArray range(int low_bit, int size); - CONSTEXPR static bool has_max_num_bits(); - CONSTEXPR static int get_max_num_bits(); + constexpr static bool has_max_num_bits(); + constexpr static int get_max_num_bits(); - CONSTEXPR static int get_num_bits_per_word(); + constexpr static int get_num_bits_per_word(); INLINE size_t get_num_bits() const; INLINE bool get_bit(int index) const; INLINE void set_bit(int index); diff --git a/panda/src/putil/bitMask.I b/panda/src/putil/bitMask.I index 0411d06042..837101a961 100644 --- a/panda/src/putil/bitMask.I +++ b/panda/src/putil/bitMask.I @@ -110,7 +110,7 @@ range(int low_bit, int size) { * programming algorithms can use BitMask or BitArray interchangeably. */ template -CONSTEXPR bool BitMask:: +constexpr bool BitMask:: has_max_num_bits() { return true; } @@ -125,7 +125,7 @@ has_max_num_bits() { * can use BitMask or BitArray interchangeably. */ template -CONSTEXPR int BitMask:: +constexpr int BitMask:: get_max_num_bits() { return num_bits; } @@ -134,7 +134,7 @@ get_max_num_bits() { * Returns the number of bits available to set in the bitmask. */ template -CONSTEXPR int BitMask:: +constexpr int BitMask:: get_num_bits() { return num_bits; } diff --git a/panda/src/putil/bitMask.h b/panda/src/putil/bitMask.h index 5333562025..589c4dd73c 100644 --- a/panda/src/putil/bitMask.h +++ b/panda/src/putil/bitMask.h @@ -45,10 +45,10 @@ PUBLISHED: INLINE static BitMask bit(int index); INLINE static BitMask range(int low_bit, int size); - CONSTEXPR static bool has_max_num_bits(); - CONSTEXPR static int get_max_num_bits(); + constexpr static bool has_max_num_bits(); + constexpr static int get_max_num_bits(); - CONSTEXPR static int get_num_bits(); + constexpr static int get_num_bits(); INLINE bool get_bit(int index) const; INLINE void set_bit(int index); INLINE void clear_bit(int index); diff --git a/panda/src/putil/buttonHandle.I b/panda/src/putil/buttonHandle.I index 2353b01689..2df12e8cd0 100644 --- a/panda/src/putil/buttonHandle.I +++ b/panda/src/putil/buttonHandle.I @@ -15,7 +15,7 @@ * Constructs a ButtonHandle with the corresponding index number, which may * have been returned by an earlier call to ButtonHandle::get_index(). */ -CONSTEXPR ButtonHandle:: +constexpr ButtonHandle:: ButtonHandle(int index) : _index(index) { } @@ -124,7 +124,7 @@ matches(const ButtonHandle &other) const { * opaque classes. This is provided for the convenience of non-C++ scripting * languages to build a hashtable of ButtonHandles. */ -CONSTEXPR int ButtonHandle:: +constexpr int ButtonHandle:: get_index() const { return _index; } diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index 429108249f..4ee27b01ae 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -23,14 +23,14 @@ * keyboard buttons and mouse buttons (but see KeyboardButton and * MouseButton). */ -class EXPCL_PANDA_PUTIL ButtonHandle FINAL { +class EXPCL_PANDA_PUTIL ButtonHandle final { PUBLISHED: // The default constructor must do nothing, because we can't guarantee // ordering of static initializers. If the constructor tried to initialize // its value, it might happen after the value had already been set // previously by another static initializer! - INLINE ButtonHandle() DEFAULT_CTOR; - CONSTEXPR ButtonHandle(int index); + INLINE ButtonHandle() = default; + constexpr ButtonHandle(int index); ButtonHandle(const string &name); PUBLISHED: @@ -51,7 +51,7 @@ PUBLISHED: INLINE bool matches(const ButtonHandle &other) const; - CONSTEXPR int get_index() const; + constexpr int get_index() const; INLINE void output(ostream &out) const; INLINE static ButtonHandle none(); diff --git a/panda/src/putil/copyOnWritePointer.I b/panda/src/putil/copyOnWritePointer.I index 9e996355fa..9354fe350a 100644 --- a/panda/src/putil/copyOnWritePointer.I +++ b/panda/src/putil/copyOnWritePointer.I @@ -69,12 +69,11 @@ INLINE CopyOnWritePointer:: } } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE CopyOnWritePointer:: -CopyOnWritePointer(CopyOnWritePointer &&from) NOEXCEPT : +CopyOnWritePointer(CopyOnWritePointer &&from) noexcept : _cow_object(from._cow_object) { // Steal the other's reference count. @@ -85,7 +84,7 @@ CopyOnWritePointer(CopyOnWritePointer &&from) NOEXCEPT : * */ INLINE CopyOnWritePointer:: -CopyOnWritePointer(PointerTo &&from) NOEXCEPT : +CopyOnWritePointer(PointerTo &&from) noexcept : _cow_object(from.p()) { // Steal the other's reference count, but because it is a regular pointer, @@ -100,7 +99,7 @@ CopyOnWritePointer(PointerTo &&from) NOEXCEPT : * */ INLINE void CopyOnWritePointer:: -operator = (CopyOnWritePointer &&from) NOEXCEPT { +operator = (CopyOnWritePointer &&from) noexcept { // Protect against self-move-assignment. if (from._cow_object != _cow_object) { CopyOnWriteObject *old_object = _cow_object; @@ -117,7 +116,7 @@ operator = (CopyOnWritePointer &&from) NOEXCEPT { * */ INLINE void CopyOnWritePointer:: -operator = (PointerTo &&from) NOEXCEPT { +operator = (PointerTo &&from) noexcept { if (from.p() != _cow_object) { CopyOnWriteObject *old_object = _cow_object; @@ -132,7 +131,6 @@ operator = (PointerTo &&from) NOEXCEPT { } } } -#endif // USE_MOVE_SEMANTICS /** * @@ -290,14 +288,13 @@ operator = (To *object) { } #endif // CPPPARSER -#ifdef USE_MOVE_SEMANTICS #ifndef CPPPARSER /** * */ template INLINE CopyOnWritePointerTo:: -CopyOnWritePointerTo(CopyOnWritePointerTo &&from) NOEXCEPT : +CopyOnWritePointerTo(CopyOnWritePointerTo &&from) noexcept : CopyOnWritePointer((CopyOnWritePointer &&)from) { } @@ -309,7 +306,7 @@ CopyOnWritePointerTo(CopyOnWritePointerTo &&from) NOEXCEPT : */ template INLINE CopyOnWritePointerTo:: -CopyOnWritePointerTo(PointerTo &&from) NOEXCEPT { +CopyOnWritePointerTo(PointerTo &&from) noexcept { // Steal the other's reference count, but because it is a regular pointer, // we do need to include the cache reference count. _cow_object = from.p(); @@ -326,7 +323,7 @@ CopyOnWritePointerTo(PointerTo &&from) NOEXCEPT { */ template INLINE void CopyOnWritePointerTo:: -operator = (CopyOnWritePointerTo &&from) NOEXCEPT { +operator = (CopyOnWritePointerTo &&from) noexcept { CopyOnWritePointer::operator = ((CopyOnWritePointer &&)from); } #endif // CPPPARSER @@ -337,7 +334,7 @@ operator = (CopyOnWritePointerTo &&from) NOEXCEPT { */ template INLINE void CopyOnWritePointerTo:: -operator = (PointerTo &&from) NOEXCEPT { +operator = (PointerTo &&from) noexcept { if (from.p() != _cow_object) { CopyOnWriteObject *old_object = _cow_object; @@ -353,7 +350,6 @@ operator = (PointerTo &&from) NOEXCEPT { } } #endif // CPPPARSER -#endif // USE_MOVE_SEMANTICS #ifndef CPPPARSER #ifdef COW_THREADED diff --git a/panda/src/putil/copyOnWritePointer.h b/panda/src/putil/copyOnWritePointer.h index 2178b6b433..a98599361a 100644 --- a/panda/src/putil/copyOnWritePointer.h +++ b/panda/src/putil/copyOnWritePointer.h @@ -32,16 +32,14 @@ class EXPCL_PANDA_PUTIL CopyOnWritePointer { public: INLINE CopyOnWritePointer(CopyOnWriteObject *object = NULL); INLINE CopyOnWritePointer(const CopyOnWritePointer ©); - INLINE void operator = (const CopyOnWritePointer ©); - INLINE void operator = (CopyOnWriteObject *object); + INLINE CopyOnWritePointer(CopyOnWritePointer &&from) noexcept; + INLINE CopyOnWritePointer(PointerTo &&from) noexcept; INLINE ~CopyOnWritePointer(); -#ifdef USE_MOVE_SEMANTICS - INLINE CopyOnWritePointer(CopyOnWritePointer &&from) NOEXCEPT; - INLINE CopyOnWritePointer(PointerTo &&from) NOEXCEPT; - INLINE void operator = (CopyOnWritePointer &&from) NOEXCEPT; - INLINE void operator = (PointerTo &&from) NOEXCEPT; -#endif + INLINE void operator = (const CopyOnWritePointer ©); + INLINE void operator = (CopyOnWritePointer &&from) noexcept; + INLINE void operator = (PointerTo &&from) noexcept; + INLINE void operator = (CopyOnWriteObject *object); INLINE bool operator == (const CopyOnWritePointer &other) const; INLINE bool operator != (const CopyOnWritePointer &other) const; @@ -82,15 +80,13 @@ public: INLINE CopyOnWritePointerTo(To *object = NULL); INLINE CopyOnWritePointerTo(const CopyOnWritePointerTo ©); + INLINE CopyOnWritePointerTo(CopyOnWritePointerTo &&from) noexcept; + INLINE CopyOnWritePointerTo(PointerTo &&from) noexcept; + INLINE void operator = (const CopyOnWritePointerTo ©); INLINE void operator = (To *object); - -#ifdef USE_MOVE_SEMANTICS - INLINE CopyOnWritePointerTo(CopyOnWritePointerTo &&from) NOEXCEPT; - INLINE CopyOnWritePointerTo(PointerTo &&from) NOEXCEPT; - INLINE void operator = (CopyOnWritePointerTo &&from) NOEXCEPT; - INLINE void operator = (PointerTo &&from) NOEXCEPT; -#endif + INLINE void operator = (CopyOnWritePointerTo &&from) noexcept; + INLINE void operator = (PointerTo &&from) noexcept; #ifdef COW_THREADED INLINE CPT(To) get_read_pointer(Thread *current_thread = Thread::get_current_thread()) const; diff --git a/panda/src/putil/doubleBitMask.I b/panda/src/putil/doubleBitMask.I index a6997af549..0b08768229 100644 --- a/panda/src/putil/doubleBitMask.I +++ b/panda/src/putil/doubleBitMask.I @@ -128,7 +128,7 @@ INLINE DoubleBitMask:: * programming algorithms can use DoubleBitMask or BitArray interchangeably. */ template -CONSTEXPR bool DoubleBitMask:: +constexpr bool DoubleBitMask:: has_max_num_bits() { return true; } @@ -143,7 +143,7 @@ has_max_num_bits() { * can use DoubleBitMask or BitArray interchangeably. */ template -CONSTEXPR int DoubleBitMask:: +constexpr int DoubleBitMask:: get_max_num_bits() { return num_bits; } @@ -152,7 +152,7 @@ get_max_num_bits() { * Returns the number of bits available to set in the doubleBitMask. */ template -CONSTEXPR int DoubleBitMask:: +constexpr int DoubleBitMask:: get_num_bits() { return num_bits; } diff --git a/panda/src/putil/doubleBitMask.h b/panda/src/putil/doubleBitMask.h index d229eb03a6..472a1ddc3f 100644 --- a/panda/src/putil/doubleBitMask.h +++ b/panda/src/putil/doubleBitMask.h @@ -49,10 +49,10 @@ PUBLISHED: INLINE ~DoubleBitMask(); - CONSTEXPR static bool has_max_num_bits(); - CONSTEXPR static int get_max_num_bits(); + constexpr static bool has_max_num_bits(); + constexpr static int get_max_num_bits(); - CONSTEXPR static int get_num_bits(); + constexpr static int get_num_bits(); INLINE bool get_bit(int index) const; INLINE void set_bit(int index); INLINE void clear_bit(int index); diff --git a/panda/src/putil/factoryParams.I b/panda/src/putil/factoryParams.I index 0c6fdd09e7..04b7d2c634 100644 --- a/panda/src/putil/factoryParams.I +++ b/panda/src/putil/factoryParams.I @@ -35,24 +35,22 @@ INLINE FactoryParams:: ~FactoryParams() { } -#ifdef USE_MOVE_SEMANTICS /** * */ INLINE FactoryParams:: -FactoryParams(FactoryParams &&from) NOEXCEPT : - _params(move(from._params)), +FactoryParams(FactoryParams &&from) noexcept : + _params(std::move(from._params)), _user_data(from._user_data) {} /** * */ INLINE void FactoryParams:: -operator = (FactoryParams &&from) NOEXCEPT { - _params = move(from._params); +operator = (FactoryParams &&from) noexcept { + _params = std::move(from._params); _user_data = from._user_data; } -#endif /** * Returns the custom pointer that was associated with the factory function. diff --git a/panda/src/putil/factoryParams.h b/panda/src/putil/factoryParams.h index 5c45a6e2ee..3f987e7f66 100644 --- a/panda/src/putil/factoryParams.h +++ b/panda/src/putil/factoryParams.h @@ -37,12 +37,10 @@ class EXPCL_PANDA_PUTIL FactoryParams { public: INLINE FactoryParams(); INLINE FactoryParams(const FactoryParams ©); + INLINE FactoryParams(FactoryParams &&from) noexcept; INLINE ~FactoryParams(); -#ifdef USE_MOVE_SEMANTICS - INLINE FactoryParams(FactoryParams &&from) NOEXCEPT; - INLINE void operator = (FactoryParams &&from) NOEXCEPT; -#endif + INLINE void operator = (FactoryParams &&from) noexcept; void add_param(FactoryParam *param); void clear(); diff --git a/panda/src/putil/iterator_types.h b/panda/src/putil/iterator_types.h index 2f2966cde7..80d8f32882 100644 --- a/panda/src/putil/iterator_types.h +++ b/panda/src/putil/iterator_types.h @@ -26,7 +26,7 @@ class first_of_pair_iterator : public pair_iterator { public: typedef TYPENAME pair_iterator::value_type::first_type value_type; - first_of_pair_iterator() DEFAULT_CTOR; + first_of_pair_iterator() = default; first_of_pair_iterator(const pair_iterator &init) : pair_iterator(init) { } value_type operator *() { @@ -44,7 +44,7 @@ class second_of_pair_iterator : public pair_iterator { public: typedef TYPENAME pair_iterator::value_type::second_type value_type; - second_of_pair_iterator() DEFAULT_CTOR; + second_of_pair_iterator() = default; second_of_pair_iterator(const pair_iterator &init) : pair_iterator(init) { } value_type operator *() { @@ -61,7 +61,7 @@ class typecast_iterator : public base_iterator { public: typedef new_type value_type; - typecast_iterator() DEFAULT_CTOR; + typecast_iterator() = default; typecast_iterator(const base_iterator &init) : base_iterator(init) { } value_type operator *() { diff --git a/panda/src/putil/simpleHashMap.I b/panda/src/putil/simpleHashMap.I index 26728f1e01..2cc4e006df 100644 --- a/panda/src/putil/simpleHashMap.I +++ b/panda/src/putil/simpleHashMap.I @@ -15,7 +15,7 @@ * */ template -CONSTEXPR SimpleHashMap:: +constexpr SimpleHashMap:: SimpleHashMap(const Compare &comp) : _table(nullptr), _deleted_chain(nullptr), @@ -55,7 +55,7 @@ SimpleHashMap(const SimpleHashMap ©) : */ template INLINE SimpleHashMap:: -SimpleHashMap(SimpleHashMap &&from) NOEXCEPT : +SimpleHashMap(SimpleHashMap &&from) noexcept : _table(from._table), _deleted_chain(from._deleted_chain), _table_size(from._table_size), @@ -109,7 +109,7 @@ operator = (const SimpleHashMap ©) { */ template INLINE SimpleHashMap &SimpleHashMap:: -operator = (SimpleHashMap &&from) NOEXCEPT { +operator = (SimpleHashMap &&from) noexcept { if (this != &from) { _table = from._table; _deleted_chain = from._deleted_chain; @@ -360,7 +360,7 @@ operator [] (const Key &key) { * Returns the total number of entries in the table. Same as get_num_entries. */ template -CONSTEXPR size_t SimpleHashMap:: +constexpr size_t SimpleHashMap:: size() const { return _num_entries; } diff --git a/panda/src/putil/simpleHashMap.h b/panda/src/putil/simpleHashMap.h index 68f6352a88..6d08de5554 100644 --- a/panda/src/putil/simpleHashMap.h +++ b/panda/src/putil/simpleHashMap.h @@ -59,8 +59,8 @@ public: Key _key; - ALWAYS_INLINE_CONSTEXPR static nullptr_t get_data() { return nullptr; } - ALWAYS_INLINE_CONSTEXPR static nullptr_t modify_data() { return nullptr; } + ALWAYS_INLINE constexpr static nullptr_t get_data() { return nullptr; } + ALWAYS_INLINE constexpr static nullptr_t modify_data() { return nullptr; } ALWAYS_INLINE static void set_data(nullptr_t) {} }; @@ -85,13 +85,13 @@ class SimpleHashMap { public: #ifndef CPPPARSER - CONSTEXPR SimpleHashMap(const Compare &comp = Compare()); + constexpr SimpleHashMap(const Compare &comp = Compare()); INLINE SimpleHashMap(const SimpleHashMap ©); - INLINE SimpleHashMap(SimpleHashMap &&from) NOEXCEPT; + INLINE SimpleHashMap(SimpleHashMap &&from) noexcept; INLINE ~SimpleHashMap(); INLINE SimpleHashMap &operator = (const SimpleHashMap ©); - INLINE SimpleHashMap &operator = (SimpleHashMap &&from) NOEXCEPT; + INLINE SimpleHashMap &operator = (SimpleHashMap &&from) noexcept; INLINE void swap(SimpleHashMap &other); @@ -101,7 +101,7 @@ public: void clear(); INLINE Value &operator [] (const Key &key); - CONSTEXPR size_t size() const; + constexpr size_t size() const; INLINE const Key &get_key(size_t n) const; INLINE const Value &get_data(size_t n) const; diff --git a/panda/src/putil/updateSeq.I b/panda/src/putil/updateSeq.I index 99703059d4..1df2577c35 100644 --- a/panda/src/putil/updateSeq.I +++ b/panda/src/putil/updateSeq.I @@ -14,21 +14,21 @@ /** * Creates an UpdateSeq in the given state. */ -CONSTEXPR UpdateSeq:: +constexpr UpdateSeq:: UpdateSeq(unsigned int seq) : _seq(seq) { } /** * Creates an UpdateSeq in the 'initial' state. */ -CONSTEXPR UpdateSeq:: +constexpr UpdateSeq:: UpdateSeq() : _seq((unsigned int)SC_initial) { } /** * Returns an UpdateSeq in the 'initial' state. */ -CONSTEXPR UpdateSeq UpdateSeq:: +constexpr UpdateSeq UpdateSeq:: initial() { return UpdateSeq((unsigned int)SC_initial); } @@ -36,7 +36,7 @@ initial() { /** * Returns an UpdateSeq in the 'old' state. */ -CONSTEXPR UpdateSeq UpdateSeq:: +constexpr UpdateSeq UpdateSeq:: old() { return UpdateSeq((unsigned int)SC_old); } @@ -44,7 +44,7 @@ old() { /** * Returns an UpdateSeq in the 'fresh' state. */ -CONSTEXPR UpdateSeq UpdateSeq:: +constexpr UpdateSeq UpdateSeq:: fresh() { return UpdateSeq((unsigned int)SC_fresh); } @@ -59,8 +59,8 @@ UpdateSeq(const UpdateSeq ©) : _seq(AtomicAdjust::get(copy._seq)) { /** * */ -CONSTEXPR UpdateSeq:: -UpdateSeq(const UpdateSeq &&from) NOEXCEPT : _seq(from._seq) { +constexpr UpdateSeq:: +UpdateSeq(const UpdateSeq &&from) noexcept : _seq(from._seq) { } /** diff --git a/panda/src/putil/updateSeq.h b/panda/src/putil/updateSeq.h index 5ba9de908f..4a982df279 100644 --- a/panda/src/putil/updateSeq.h +++ b/panda/src/putil/updateSeq.h @@ -36,16 +36,16 @@ */ class EXPCL_PANDA_PUTIL UpdateSeq { private: - CONSTEXPR UpdateSeq(unsigned int seq); + constexpr UpdateSeq(unsigned int seq); PUBLISHED: - CONSTEXPR UpdateSeq(); - CONSTEXPR static UpdateSeq initial(); - CONSTEXPR static UpdateSeq old(); - CONSTEXPR static UpdateSeq fresh(); + constexpr UpdateSeq(); + constexpr static UpdateSeq initial(); + constexpr static UpdateSeq old(); + constexpr static UpdateSeq fresh(); INLINE UpdateSeq(const UpdateSeq ©); - CONSTEXPR UpdateSeq(const UpdateSeq &&from) NOEXCEPT; + constexpr UpdateSeq(const UpdateSeq &&from) noexcept; INLINE UpdateSeq &operator = (const UpdateSeq ©); INLINE void clear(); diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I index a3246c19ec..514818a9be 100644 --- a/panda/src/putil/weakKeyHashMap.I +++ b/panda/src/putil/weakKeyHashMap.I @@ -295,7 +295,6 @@ set_data(size_t n, const Value &data) { _table[n]._data = data; } -#ifdef USE_MOVE_SEMANTICS /** * Changes the data for the nth slot of the table. * @@ -309,7 +308,6 @@ set_data(size_t n, Value &&data) { nassertv(has_element(n)); _table[n]._data = move(data); } -#endif // USE_MOVE_SEMANTICS /** * Removes the nth slot from the table. @@ -611,13 +609,9 @@ expand_table() { new_index = (new_index + 1) & (_table_size - 1); } -#ifdef USE_MOVE_SEMANTICS // Use C++11 rvalue references to invoke the move constructor, which may // be more efficient. - new(&_table[new_index]) TableEntry(move(old_map._table[i])); -#else - new(&_table[new_index]) TableEntry(old_map._table[i]); -#endif + new(&_table[new_index]) TableEntry(std::move(old_map._table[i])); exists_array[new_index] = true; ++_num_entries; } diff --git a/panda/src/putil/weakKeyHashMap.h b/panda/src/putil/weakKeyHashMap.h index 3769660fbc..b29a846e96 100644 --- a/panda/src/putil/weakKeyHashMap.h +++ b/panda/src/putil/weakKeyHashMap.h @@ -50,9 +50,7 @@ public: INLINE const Value &get_data(size_t n) const; INLINE Value &modify_data(size_t n); INLINE void set_data(size_t n, const Value &data); -#ifdef USE_MOVE_SEMANTICS INLINE void set_data(size_t n, Value &&data); -#endif void remove_element(size_t n); INLINE size_t get_num_entries() const; @@ -82,11 +80,10 @@ private: INLINE TableEntry(const TableEntry ©) : _key(copy._key), _data(copy._data) {} -#ifdef USE_MOVE_SEMANTICS - INLINE TableEntry(TableEntry &&from) NOEXCEPT : - _key(move(from._key)), - _data(move(from._data)) {} -#endif + INLINE TableEntry(TableEntry &&from) noexcept : + _key(std::move(from._key)), + _data(std::move(from._data)) {} + WCPT(Key) _key; Value _data; }; diff --git a/panda/src/putil/writableParam.h b/panda/src/putil/writableParam.h index 7bd49ebd30..bc0f600696 100644 --- a/panda/src/putil/writableParam.h +++ b/panda/src/putil/writableParam.h @@ -39,7 +39,7 @@ public: private: // The assignment operator cannot be used for this class. - WritableParam &operator = (const WritableParam &other) DELETED_ASSIGN; + WritableParam &operator = (const WritableParam &other) = delete; public: virtual TypeHandle get_type() const { diff --git a/panda/src/recorder/mouseRecorder.h b/panda/src/recorder/mouseRecorder.h index f43150c2b8..7122c12299 100644 --- a/panda/src/recorder/mouseRecorder.h +++ b/panda/src/recorder/mouseRecorder.h @@ -77,9 +77,9 @@ public: virtual void write_datagram(BamWriter *manager, Datagram &dg); virtual void write_recorder(BamWriter *manager, Datagram &dg); - INLINE virtual int get_ref_count() const FINAL { return ReferenceCount::get_ref_count(); }; - INLINE virtual void ref() const FINAL { ReferenceCount::ref(); }; - INLINE virtual bool unref() const FINAL { return ReferenceCount::unref(); }; + INLINE virtual int get_ref_count() const final { return ReferenceCount::get_ref_count(); }; + INLINE virtual void ref() const final { ReferenceCount::ref(); }; + INLINE virtual bool unref() const final { return ReferenceCount::unref(); }; protected: static TypedWritable *make_from_bam(const FactoryParams ¶ms); diff --git a/panda/src/recorder/socketStreamRecorder.h b/panda/src/recorder/socketStreamRecorder.h index 3b43f5ffcd..231ac19f28 100644 --- a/panda/src/recorder/socketStreamRecorder.h +++ b/panda/src/recorder/socketStreamRecorder.h @@ -74,9 +74,9 @@ public: static void register_with_read_factory(); virtual void write_recorder(BamWriter *manager, Datagram &dg); - INLINE virtual int get_ref_count() const FINAL { return ReferenceCount::get_ref_count(); }; - INLINE virtual void ref() const FINAL { ReferenceCount::ref(); }; - INLINE virtual bool unref() const FINAL { return ReferenceCount::unref(); }; + INLINE virtual int get_ref_count() const final { return ReferenceCount::get_ref_count(); }; + INLINE virtual void ref() const final { ReferenceCount::ref(); }; + INLINE virtual bool unref() const final { return ReferenceCount::unref(); }; protected: static RecorderBase *make_recorder(const FactoryParams ¶ms); diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 49c507dafd..6abe29d7a0 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -1222,7 +1222,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) { *(idx_ptr++) = i + 3; i += 4; - glyphs.push_back(MOVE(quad._glyph)); + glyphs.push_back(move(quad._glyph)); } } else { // 16-bit index case. @@ -1278,7 +1278,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) { *(idx_ptr++) = i + 3; i += 4; - glyphs.push_back(MOVE(quad._glyph)); + glyphs.push_back(move(quad._glyph)); } } } @@ -1796,7 +1796,7 @@ draw_underscore(TextAssembler::PlacedGlyphs &placed_glyphs, // LVecBase4(0), RenderState::make_empty()); GlyphPlacement placement; - placement._glyph = MOVE(glyph); + placement._glyph = move(glyph); placement._xpos = 0; placement._ypos = 0; placement._scale = 1; @@ -2453,7 +2453,7 @@ assign_quad_to(QuadMap &quad_map, const RenderState *state, quad._dimensions += LVecBase4(offset[0], -offset[1], offset[0], -offset[1]); quad._glyph = _glyph; - quad_map[state->compose(_glyph->get_state())].push_back(MOVE(quad)); + quad_map[state->compose(_glyph->get_state())].push_back(move(quad)); } }