diff options
author | Patrick Simianer <p@simianer.de> | 2013-11-26 11:11:17 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2013-11-26 11:11:17 +0100 |
commit | e346cd5cd3c5d7164819c35e485a9850d825996e (patch) | |
tree | 6c09b737569ac8471fa2a6dfda71230c554be0c8 /utils/small_vector.h | |
parent | 95a69136109665881be66ff4e8f9eca6abb08477 (diff) | |
parent | 62a2526e69eb1570bf349763fc8bb65179337918 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'utils/small_vector.h')
-rw-r--r-- | utils/small_vector.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/small_vector.h b/utils/small_vector.h index c8a69927..280ab72c 100644 --- a/utils/small_vector.h +++ b/utils/small_vector.h @@ -14,7 +14,6 @@ #include <stdint.h> #include <new> #include <stdint.h> -#include "swap_pod.h" #include <boost/functional/hash.hpp> //sizeof(T)/sizeof(T*)>1?sizeof(T)/sizeof(T*):1 @@ -278,8 +277,15 @@ public: return !(a==b); } - void swap(Self& o) { - swap_pod(*this,o); + inline void swap(Self& o) { + const unsigned s=sizeof(SmallVector<T,SV_MAX>); + char tmp[s]; + void *pt=static_cast<void*>(tmp); + void *pa=static_cast<void*>(this); + void *pb=static_cast<void*>(&o); + std::memcpy(pt,pa,s); + std::memcpy(pa,pb,s); + std::memcpy(pb,pt,s); } inline std::size_t hash_impl() const { |