summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-07-03 11:34:02 +0200
committerljfa-ag <ljfa-ag@web.de>2015-07-03 11:34:02 +0200
commit56da3e25fa303ce509e5953db4cdd8a7985cf2c5 (patch)
treed2452ceeb53eab28c3ef4786104665b107f3c607 /include
parentbb41bd0013c9c0fec657d352bfcbea116c4c696f (diff)
downloadProject-Tick-56da3e25fa303ce509e5953db4cdd8a7985cf2c5.tar.gz
Project-Tick-56da3e25fa303ce509e5953db4cdd8a7985cf2c5.zip
Reorder and change documentation for value
Diffstat (limited to 'include')
-rw-r--r--include/value.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/value.h b/include/value.h
index afcc7c2624..06f86e3a21 100644
--- a/include/value.h
+++ b/include/value.h
@@ -56,6 +56,10 @@ public:
*/
value& operator=(tag&& t);
+ //Conversion to tag
+ operator tag&();
+ operator const tag&() const;
+
//Assignment of primitives and string
/**
* @brief Assigns the given value to the tag if the type is compatible
@@ -68,15 +72,17 @@ public:
value& operator=(int64_t val);
value& operator=(float val);
value& operator=(double val);
- value& operator=(const std::string& str);
- //Conversion to tag
- operator tag&();
- operator const tag&() const;
+ /**
+ * @brief Assigns the given string to the tag if it is a tag_string
+ * @throw std::bad_cast if the contained tag is not a tag_string
+ */
+ value& operator=(const std::string& str);
+ value& operator=(std::string&& str);
//Conversions to primitives and string
/**
- * @brief Casts the value if the type matches
+ * @brief Returns the contained value if the type is compatible
* @throw std::bad_cast if the tag type is not convertible to the desired
* type via a widening conversion
*/
@@ -86,9 +92,14 @@ public:
operator int64_t() const;
operator float() const;
operator double() const;
+
+ /**
+ * @brief Returns the contained string if the type is tag_string
+ * @throw std::bad_cast if the tag type is not tag_string
+ */
operator const std::string&() const;
- ///Returns true if the contained tag is not @c nullptr
+ ///Returns true if the value is not uninitialized
explicit operator bool() const;
/**