diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-08 18:20:02 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-08 18:20:02 +0200 |
| commit | 0b0b7c343fd1d40a10d7c756237b8e86207d8b97 (patch) | |
| tree | 4008400c3408a3a47ab9a8670933fa8f9109bbcd | |
| parent | d9f87a8f9bbd8b296bd876cbb5fb3e410c6a76e3 (diff) | |
| download | Project-Tick-0b0b7c343fd1d40a10d7c756237b8e86207d8b97.tar.gz Project-Tick-0b0b7c343fd1d40a10d7c756237b8e86207d8b97.zip | |
Overload clone for rvalue refs
| -rw-r--r-- | include/tag.h | 1 | ||||
| -rw-r--r-- | src/tag.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/tag.h b/include/tag.h index da1d5098ad..c38c9a5117 100644 --- a/include/tag.h +++ b/include/tag.h @@ -56,6 +56,7 @@ public: virtual std::unique_ptr<tag> clone() const& = 0; virtual std::unique_ptr<tag> move_clone() && = 0; + std::unique_ptr<tag> clone() &&; friend bool operator==(const tag& lhs, const tag& rhs); friend bool operator!=(const tag& lhs, const tag& rhs); diff --git a/src/tag.cpp b/src/tag.cpp index 40565226cf..da5c3fa68e 100644 --- a/src/tag.cpp +++ b/src/tag.cpp @@ -23,6 +23,11 @@ namespace nbt { +std::unique_ptr<tag> tag::clone() && +{ + return std::move(*this).move_clone(); +} + bool operator==(const tag& lhs, const tag& rhs) { if(typeid(lhs) != typeid(rhs)) |
