From 3a99fb629cf059061d2aba9aab3a18d9ebe5703c Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 22 Jul 2015 16:55:58 +0200 Subject: Add a few comments --- include/value.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/value.h') diff --git a/include/value.h b/include/value.h index 670fc3fe8e..7c9511d74d 100644 --- a/include/value.h +++ b/include/value.h @@ -34,8 +34,6 @@ namespace nbt * A value can contain any kind of tag or no tag (nullptr) and provides * operations for handling tags of which the type is not known at compile time. * Assignment or the set method on a value with no tag will fill in the value. - * Once the value contains a tag, the type of the contained tag will not change - * unless set_ptr is used. * * The rationale for the existance of this class is to provide a type-erasured * means of storing tags, especially when they are contained in tag_compound @@ -62,6 +60,7 @@ namespace nbt class value { public: + //Constructors value() {} explicit value(std::unique_ptr&& t); explicit value(tag&& t); @@ -189,8 +188,10 @@ public: value& operator[](size_t i); const value& operator[](size_t i) const; + ///Returns a reference to the underlying std::unique_ptr std::unique_ptr& get_ptr(); const std::unique_ptr& get_ptr() const; + ///Resets the underlying std::unique_ptr to a different value void set_ptr(std::unique_ptr&& t); ///@sa tag::get_type -- cgit 0.0.5-2-1-g0f52