diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-01 19:28:51 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-01 19:30:24 +0200 |
| commit | 6168f3ad47a5eddd6b10a84455f8fbd5a9852818 (patch) | |
| tree | d1bbeb2cf39f4f017b535056fe640f6f54199084 | |
| parent | d648754b1f35e7a6465869157ae9afa0b0ee451d (diff) | |
| download | Project-Tick-6168f3ad47a5eddd6b10a84455f8fbd5a9852818.tar.gz Project-Tick-6168f3ad47a5eddd6b10a84455f8fbd5a9852818.zip | |
Change description of value::operator=
Remove value constructor from tag&&
| -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); |
