From 4db106fcc3fe2c14786153ed42601fd102516eb6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 4 Apr 2015 15:27:50 +0000 Subject: [PATCH] changed QSE_CPP_ENABLE_CPP1_MOVE to QSE_CPP_ENABLE_CPP11_MOVE --- qse/include/qse/Types.hpp | 6 +++--- qse/include/qse/cmn/Array.hpp | 22 +++++++++++----------- qse/include/qse/cmn/BinaryHeap.hpp | 8 ++++---- qse/samples/cmn/arr02.cpp | 6 +++--- qse/samples/cmn/bh02.cpp | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/qse/include/qse/Types.hpp b/qse/include/qse/Types.hpp index 8633a7d4..19b158ab 100644 --- a/qse/include/qse/Types.hpp +++ b/qse/include/qse/Types.hpp @@ -36,9 +36,9 @@ #if (__cplusplus >= 201103L) // C++11 - /// The QSE_CPP_ENABLE_CPP1_MOVE macro enables C++11 move semantics + /// The QSE_CPP_ENABLE_CPP11_MOVE macro enables C++11 move semantics /// in various classes. - #define QSE_CPP_ENABLE_CPP1_MOVE 1 + #define QSE_CPP_ENABLE_CPP11_MOVE 1 // The QSE_CPP_CALL_DESTRUCTOR() macro calls a destructor explicitly. #define QSE_CPP_CALL_DESTRUCTOR(ptr, class_name) ((ptr)->~class_name()) @@ -114,7 +114,7 @@ #endif -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) template struct QSE_CPP_RMREF { typedef T Type; }; template struct QSE_CPP_RMREF { typedef T Type; }; diff --git a/qse/include/qse/cmn/Array.hpp b/qse/include/qse/cmn/Array.hpp index 0495afe7..058576ea 100644 --- a/qse/include/qse/cmn/Array.hpp +++ b/qse/include/qse/cmn/Array.hpp @@ -128,7 +128,7 @@ public: } } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) Array (SelfType&& array): Mmged(array.getMmgr()), @@ -168,7 +168,7 @@ public: return *this; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) SelfType& operator= (SelfType&& array) { if (this != &array) @@ -236,7 +236,7 @@ protected: return tmp; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) T* clone_buffer_by_moving (T* srcbuf, qse_size_t capa, qse_size_t cnt) { QSE_ASSERT (capa > 0); @@ -306,7 +306,7 @@ protected: } } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) void put_item_by_moving (qse_size_t index, T&& value) { if (index >= this->count) @@ -432,7 +432,7 @@ public: this->update (index, value); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) void setValueAt (qse_size_t index, T&& value) { this->update (index, QSE_CPP_RVREF(value)); @@ -466,7 +466,7 @@ protected: // shift the existing elements to the back by one slot. for (qse_size_t i = this->count; i > index; i--) { - #if defined(QSE_CPP_ENABLE_CPP1_MOVE) + #if defined(QSE_CPP_ENABLE_CPP11_MOVE) this->put_item_by_moving (i, QSE_CPP_RVREF(this->buffer[i - 1])); #else this->put_item (i, this->buffer[i - 1]); @@ -503,7 +503,7 @@ public: return index; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t insert (qse_size_t index, T&& value) { // Unlike insert() in RedBlackTree and HashList, @@ -530,7 +530,7 @@ public: return index; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t update (qse_size_t index, T&& value) { QSE_ASSERT (index < this->count); @@ -548,7 +548,7 @@ public: return this->insert (index, value); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t upsert (qse_size_t index, T&& value) { if (index < this->count) @@ -566,7 +566,7 @@ public: return this->insert (index, value); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t ensert (qse_size_t index, T&& value) { if (index < this->count) @@ -700,7 +700,7 @@ public: qse_size_t cnt = this->count; if (cnt > capa) cnt = capa; - #if defined(QSE_CPP_ENABLE_CPP1_MOVE) + #if defined(QSE_CPP_ENABLE_CPP11_MOVE) T* tmp = this->clone_buffer_by_moving (this->buffer, capa, cnt); #else T* tmp = this->clone_buffer (this->buffer, capa, cnt); diff --git a/qse/include/qse/cmn/BinaryHeap.hpp b/qse/include/qse/cmn/BinaryHeap.hpp index 432485d6..ee03dcac 100644 --- a/qse/include/qse/cmn/BinaryHeap.hpp +++ b/qse/include/qse/cmn/BinaryHeap.hpp @@ -135,7 +135,7 @@ public: { } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) BinaryHeap (SelfType& heap): ParentType (heap) { } @@ -154,7 +154,7 @@ public: return *this; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) SelfType& operator= (SelfType&& heap) { if (this != &heap) @@ -212,7 +212,7 @@ public: return this->sift_up(index); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t insert (T&& value) { qse_size_t index = this->count; @@ -234,7 +234,7 @@ public: return (this->greater_than(value, old))? this->sift_up(index): this->sift_down(index); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) qse_size_t update (qse_size_t index, T&& value) { T old = QSE_CPP_RVREF(this->buffer[index]); diff --git a/qse/samples/cmn/arr02.cpp b/qse/samples/cmn/arr02.cpp index 0ab323e0..50110689 100644 --- a/qse/samples/cmn/arr02.cpp +++ b/qse/samples/cmn/arr02.cpp @@ -20,7 +20,7 @@ printf ("copy constructor %d\n", *q.x); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) Julia (Julia&& q) { printf ("move constructor %d\n", *q.x); @@ -51,7 +51,7 @@ printf ("operator= %d\n", *q.x); return *this; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) Julia& operator= (Julia&& q) { if (this != &q) @@ -86,7 +86,7 @@ int main () a0.remove (2, 5); a0.update (5, Julia(9999)); -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) JuliaArray a1 ((JuliaArray&&)a0); #else JuliaArray a1 (a0); diff --git a/qse/samples/cmn/bh02.cpp b/qse/samples/cmn/bh02.cpp index 61cfaaf3..cb2e0820 100644 --- a/qse/samples/cmn/bh02.cpp +++ b/qse/samples/cmn/bh02.cpp @@ -19,7 +19,7 @@ public: this->x = new int (*q.x); } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) Julia (Julia&& q) { this->x = q.x; @@ -46,7 +46,7 @@ public: return *this; } -#if defined(QSE_CPP_ENABLE_CPP1_MOVE) +#if defined(QSE_CPP_ENABLE_CPP11_MOVE) Julia& operator= (Julia&& q) { if (this != &q)