diff options
| -rw-r--r-- | include/value.h | 17 | ||||
| -rw-r--r-- | src/value.cpp | 4 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/value.h b/include/value.h index bcad7f3468..491a92b2a0 100644 --- a/include/value.h +++ b/include/value.h @@ -41,11 +41,6 @@ class value { public: explicit value() {} - explicit value(std::unique_ptr<tag>&& t); - explicit value(tag&& t); - - value& operator=(std::unique_ptr<tag>&& t); - value& operator=(tag&& t); //Movable but not (implicitly) copyable value(const value&) = delete; @@ -53,9 +48,19 @@ public: value& operator=(const value&) = delete; value& operator=(value&&) = default; - //Assignment of primitives and string + explicit value(std::unique_ptr<tag>&& t); + value& operator=(std::unique_ptr<tag>&& t); + /** * @brief Assigns the given value to the tag if the type matches + * @throw std::bad_cast if the type of @c t is not the same as the type + * of this value + */ + value& operator=(tag&& t); + + //Assignment of primitives and string + /** + * @brief Assigns the given value to the tag if the type is compatible * @throw std::bad_cast if the value is not convertible to the tag type * via a widening conversion */ diff --git a/src/value.cpp b/src/value.cpp index 574c23d087..339c737505 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -27,10 +27,6 @@ value::value(std::unique_ptr<tag>&& t): tag_(std::move(t)) {} -value::value(tag&& t): - tag_(std::move(t).move_clone()) -{} - value& value::operator=(std::unique_ptr<tag>&& t) { tag_ = std::move(t); |
