From 7c890dce034d3222967096faf1fe07494d374dff Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 23 Feb 2016 13:42:57 +0100 Subject: [PATCH] Add set method for Slice in velocypack. --- 3rdParty/velocypack/include/velocypack/Slice.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/3rdParty/velocypack/include/velocypack/Slice.h b/3rdParty/velocypack/include/velocypack/Slice.h index 87333fd522..f052576c30 100644 --- a/3rdParty/velocypack/include/velocypack/Slice.h +++ b/3rdParty/velocypack/include/velocypack/Slice.h @@ -95,6 +95,9 @@ class Slice { // pointer to the head byte uint8_t const* start() const { return _start; } + // Set new memory position + void set(uint8_t const* s) { _start = s; } + // pointer to the head byte template T const* startAs() const { @@ -660,6 +663,7 @@ class Slice { // check if two Slices are equal on the binary level bool equals(Slice const& other) const; + bool operator==(Slice const& other) const { return equals(other); } static bool equals(uint8_t const* left, uint8_t const* right) { return Slice(left).equals(Slice(right)); @@ -775,14 +779,6 @@ struct hash { } }; -// implementation of std::equal_to for two Slice objects -template <> -struct equal_to { - bool operator()(arangodb::velocypack::Slice const& left, - arangodb::velocypack::Slice const& right) const { - return left.equals(right); - } -}; } std::ostream& operator<<(std::ostream&, arangodb::velocypack::Slice const*);