]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/format.h
Make lexical_cast symmetric
[libs/core.git] / source / strings / format.h
index 9264b10bad1ec2b2f951065d3ee1562d8f033d27..65d10dffa585bb6e272db7d1d20a71a07b6a0a42 100644 (file)
@@ -24,14 +24,23 @@ public:
        template<typename T>
        Formatter &operator()(const T &a)
        {
        template<typename T>
        Formatter &operator()(const T &a)
        {
-               result += lexical_cast(a, get_conversion());
+               result += lexical_cast<std::string>(a, get_conversion());
                advance();
                return *this;
        }
 
                advance();
                return *this;
        }
 
+       /** Returns the result of the formatting operation.  Will throw if not
+       enough values have been fed to the formatter. */
        const std::string &str() const;
        const std::string &str() const;
+
 private:
 private:
+       /** Advances the iterator to the next conversion, adding literal characters
+       to the result.  The iterator is left at the second character of the
+       conversion (i.e. after the %). */
        void advance();
        void advance();
+
+       /** Reads the next conversion from the format string and returns a
+       corresponding Fmt object. */
        Fmt get_conversion();
 };
 
        Fmt get_conversion();
 };