diff options
author | Travis CI <zmoelnig@travis-ci.umlaeute.mur.at> | 2016-12-22 09:43:00 +0000 |
---|---|---|
committer | Travis CI <zmoelnig@travis-ci.umlaeute.mur.at> | 2016-12-22 09:43:00 +0000 |
commit | 0eebd0e55dd610971a6ccd711278cbc480a4361e (patch) | |
tree | dd63fffe7325128ddbc640c1d559b268658b8780 /Gem/develop/include | |
parent | 315d1e5fc3e8367c187c39fda97cd6439765a9d7 (diff) |
Gem cb323f8641d6d15e14a9946ad2b35c74578f6a80 linux/amd64
built 'master:cb323f8641d6d15e14a9946ad2b35c74578f6a80' for linux/amd64
Diffstat (limited to 'Gem/develop/include')
-rw-r--r-- | Gem/develop/include/Gem/Gem/GLStack.h | 5 | ||||
-rw-r--r-- | Gem/develop/include/Gem/Utils/any.h | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/Gem/develop/include/Gem/Gem/GLStack.h b/Gem/develop/include/Gem/Gem/GLStack.h index 2584578..4c9037c 100644 --- a/Gem/develop/include/Gem/Gem/GLStack.h +++ b/Gem/develop/include/Gem/Gem/GLStack.h @@ -65,7 +65,12 @@ class GEM_EXTERN GLStack { private: class Data; + // try using unique_ptr<> if it is supported +#if __cplusplus < 201103L std::auto_ptr<Data>data; +#else + std::unique_ptr<Data>data; +#endif }; } /* namespace gem */ diff --git a/Gem/develop/include/Gem/Utils/any.h b/Gem/develop/include/Gem/Utils/any.h index fc66b46..dff11bb 100644 --- a/Gem/develop/include/Gem/Utils/any.h +++ b/Gem/develop/include/Gem/Utils/any.h @@ -132,12 +132,19 @@ namespace gem template <typename T> any(const T& x) : table(NULL), object(NULL) { table = any_detail::get_table<T>::get(); +#if defined(__GNUC__) && __GNUC__ >= 6 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wplacement-new" +#endif if (sizeof(T) <= sizeof(void*)) { new(&object) T(x); } else { object = new T(x); } +#if defined(__GNUC__) && __GNUC__ >= 6 +# pragma GCC diagnostic pop +#endif } any(void) : table(NULL), object(NULL) { @@ -181,14 +188,16 @@ namespace gem if (table == x_table) { // if so, we can avoid deallocating and resuse memory +#if defined(__GNUC__) && __GNUC__ >= 6 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wplacement-new" +#endif if (sizeof(T) <= sizeof(void*)) { // create copy on-top of object pointer itself - new(&object) T(x); } else { // create copy on-top of old version - new(object) T(x); } } @@ -196,16 +205,17 @@ namespace gem reset(); if (sizeof(T) <= sizeof(void*)) { // create copy on-top of object pointer itself - new(&object) T(x); // update table pointer - table = x_table; } else { object = new T(x); table = x_table; } +#if defined(__GNUC__) && __GNUC__ >= 6 +# pragma GCC diagnostic pop +#endif } return *this; } |