Add comment about error-checking to docu of string_to<T>
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 2 Dec 2016 13:47:54 +0000 (14:47 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 2 Dec 2016 13:47:54 +0000 (14:47 +0100)
src/stringfunc.hxx

index 13ef703..67c38e7 100644 (file)
@@ -151,6 +151,11 @@ std::string convert_hex_to_binary(const std::string& str) throw(std::runtime_err
 /**
  * convert a datatype @a T to a string via string stream.
  *
+ * This will not report trouble in conversion; for example:
+ *     string_to<int>("christian")
+ * will return 0 and not throw an error.
+ * Use boost::lexical_cast<T>(string) to get error-checked results.
+ *
  * @param s the string which should be converted to @a T.
  * @return the value of type T.
  */