diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-22 16:55:58 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-22 20:29:56 +0200 |
| commit | 3a99fb629cf059061d2aba9aab3a18d9ebe5703c (patch) | |
| tree | 57ab285986c356b5ba27c3623ed50a35132018ca /include/value.h | |
| parent | 473f094be33ccd92c003ec25c9a9f940629ecdc9 (diff) | |
| download | Project-Tick-3a99fb629cf059061d2aba9aab3a18d9ebe5703c.tar.gz Project-Tick-3a99fb629cf059061d2aba9aab3a18d9ebe5703c.zip | |
Add a few comments
Diffstat (limited to 'include/value.h')
| -rw-r--r-- | include/value.h | 5 |
1 files changed, 3 insertions, 2 deletions
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<tag>&& 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<tag> std::unique_ptr<tag>& get_ptr(); const std::unique_ptr<tag>& get_ptr() const; + ///Resets the underlying std::unique_ptr<tag> to a different value void set_ptr(std::unique_ptr<tag>&& t); ///@sa tag::get_type |
