diff options
Diffstat (limited to 'include/value.h')
| -rw-r--r-- | include/value.h | 17 |
1 files changed, 11 insertions, 6 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 */ |
