From: Mikko Rasa Date: Wed, 16 Jan 2013 16:45:30 +0000 (+0200) Subject: Comment changes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ea901644ac2d36256d1f38c7a3adaaee787fe1b9;p=libs%2Fcore.git Comment changes --- diff --git a/source/strings/lexicalcast.h b/source/strings/lexicalcast.h index 25e3268..2ed0621 100644 --- a/source/strings/lexicalcast.h +++ b/source/strings/lexicalcast.h @@ -10,7 +10,7 @@ namespace Msp { /** -Thrown for errors in lexical conversions +Thrown for errors in lexical conversions. */ class lexical_error: public std::runtime_error { @@ -20,6 +20,9 @@ public: }; +/** +Thrown when the format is unsuitable for the type being converted. +*/ class format_mismatch: public lexical_error { public: @@ -141,8 +144,9 @@ operator>>(const LexicalConverter &c, T &v) throw lexical_error("conversion failure"); } -// Helper struct to provide partial template specialization - +/** +Helper struct to provide partial template specialization. +*/ template struct LexicalCast; @@ -180,8 +184,10 @@ struct LexicalCast } }; -// The main interface to the lexical conversion machinery - +/** Perform a lexical conversion between a string and another type. The source +type can normally be deduced by the compiler, so this can be used just like the +standard C++ casts. A format may additionally be specified to force a specific +interpretation. */ template inline T lexical_cast(const F &v, const Fmt &f = Fmt()) {