From 7c36efbaa9f526fb42897ecef3185ad2d5268dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 7 Sep 2015 18:26:53 +0200 Subject: [PATCH] Added assignment and explicit copy constructor --- .../intrusive/detail/tree_value_compare.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/boost/intrusive/detail/tree_value_compare.hpp b/include/boost/intrusive/detail/tree_value_compare.hpp index a05741e..62817ca 100644 --- a/include/boost/intrusive/detail/tree_value_compare.hpp +++ b/include/boost/intrusive/detail/tree_value_compare.hpp @@ -34,14 +34,25 @@ struct tree_value_compare typedef KeyOfValue key_of_value; typedef Key key_type; - explicit tree_value_compare(const key_compare &kcomp) - : base_t(kcomp) - {} tree_value_compare() : base_t() {} + explicit tree_value_compare(const key_compare &kcomp) + : base_t(kcomp) + {} + + tree_value_compare (const tree_value_compare &x) + : base_t(x.base_t::get()) + {} + + tree_value_compare &operator=(const tree_value_compare &x) + { this->base_t::get() = x.base_t::get(); return *this; } + + tree_value_compare &operator=(const key_compare &x) + { this->base_t::get() = x; return *this; } + const key_compare &key_comp() const { return static_cast(*this); }