From ab0391dd032c5610db0c7dd3e1b04c2623845cb5 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 12 May 2015 18:59:52 -0700 Subject: [PATCH] Give TRI_doc_mptr_copy_t a move constructor and move assignment operator. This is in the hope of allowing the compiler to speed up some things. --- arangod/VocBase/document-collection.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arangod/VocBase/document-collection.h b/arangod/VocBase/document-collection.h index 8ed0938763..37a7880ab8 100644 --- a/arangod/VocBase/document-collection.h +++ b/arangod/VocBase/document-collection.h @@ -241,6 +241,17 @@ struct TRI_doc_mptr_copy_t : public TRI_doc_mptr_t { return *this; } + // Move semantics: + + TRI_doc_mptr_copy_t (TRI_doc_mptr_copy_t&& that) { + copy(that); + } + + TRI_doc_mptr_copy_t&& operator= (TRI_doc_mptr_copy_t&& that) { + copy(that); + return std::move(*this); + } + #ifndef TRI_ENABLE_MAINTAINER_MODE inline void const* getDataPtr () const { return _dataptr;