summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-08-02 21:47:01 +0200
committerljfa-ag <ljfa-ag@web.de>2015-08-02 21:47:01 +0200
commitbe7e646d091bd1f250d77f443462607b5c27a419 (patch)
tree68b6f7eeb7aa9c1d9135046ba5c97b4317d9848e /include
parenta3fb29ae603a293f12959abbc35af1bf4a156c76 (diff)
downloadProject-Tick-be7e646d091bd1f250d77f443462607b5c27a419.tar.gz
Project-Tick-be7e646d091bd1f250d77f443462607b5c27a419.zip
Create tag::create function
Diffstat (limited to 'include')
-rw-r--r--include/tag.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tag.h b/include/tag.h
index 63125f1dc5..75a41f2e1f 100644
--- a/include/tag.h
+++ b/include/tag.h
@@ -55,6 +55,7 @@ public:
///Returns the type of the tag
virtual tag_type get_type() const noexcept = 0;
+ //Polymorphic clone methods
virtual std::unique_ptr<tag> clone() const& = 0;
virtual std::unique_ptr<tag> move_clone() && = 0;
std::unique_ptr<tag> clone() &&;
@@ -65,6 +66,12 @@ public:
*/
virtual tag& assign(tag&& rhs) = 0;
+ /**
+ * @brief Default-constructs a new tag of the given type
+ * @throw std::invalid_argument if the type is not valid (e.g. End or Null)
+ */
+ static std::unique_ptr<tag> create(tag_type type);
+
friend bool operator==(const tag& lhs, const tag& rhs);
friend bool operator!=(const tag& lhs, const tag& rhs);