From cdb7f2b26e717bbfe84dbd73f949c6b06ca2b2d7 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 25 Nov 2013 00:14:16 -0500 Subject: remove dead code, add adagrad crf learner --- utils/small_vector.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'utils/small_vector.h') 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 #include #include -#include "swap_pod.h" #include //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); + char tmp[s]; + void *pt=static_cast(tmp); + void *pa=static_cast(this); + void *pb=static_cast(&o); + std::memcpy(pt,pa,s); + std::memcpy(pa,pb,s); + std::memcpy(pb,pt,s); } inline std::size_t hash_impl() const { -- cgit v1.2.3