From 4ea7019e8594254b77b72ea66e7700b2d8e6d2ef Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Tue, 7 Jul 2015 16:55:04 +0200 Subject: Specify undefined behavior on null values --- include/value.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/value.h b/include/value.h index c029e1ecad..7d3dfc0e92 100644 --- a/include/value.h +++ b/include/value.h @@ -54,6 +54,11 @@ public: void set(tag&& t); //Conversion to tag + /** + * @brief Returns the contained tag + * + * If the value is uninitialized, the behavior is undefined. + */ operator tag&(); operator const tag&() const; tag& get(); @@ -94,6 +99,8 @@ public: /** * @brief Returns the contained string if the type is tag_string + * + * If the value is uninitialized, the behavior is undefined. * @throw std::bad_cast if the tag type is not tag_string */ operator const std::string&() const; @@ -103,6 +110,8 @@ public: /** * @brief In case of a tag_compound, accesses a tag by key with bounds checking + * + * If the value is uninitialized, the behavior is undefined. * @throw std::bad_cast if the tag type is not tag_compound * @throw std::out_of_range if given key does not exist * @sa tag_compound::at @@ -112,6 +121,8 @@ public: /** * @brief In case of a tag_compound, accesses a tag by key + * + * If the value is uninitialized, the behavior is undefined. * @sa tag_compound::operator[] */ value& operator[](const std::string& key); -- cgit 0.0.5-2-1-g0f52