From 0ec92f1f03406aa3b3a1840045c3f38fa72665f1 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 15 Jun 2002 21:13:12 +0000 Subject: [PATCH] Remove a couple of bugs, clarify a couple of minor points; from Kevlin [SVN r14148] --- lexical_cast.htm | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lexical_cast.htm b/lexical_cast.htm index 47b8aaf..870068d 100644 --- a/lexical_cast.htm +++ b/lexical_cast.htm @@ -79,8 +79,13 @@ convenience for such conversions. For more involved conversions, such as where precision or formatting need tighter control than is offered by the default behavior of lexical_cast, the conventional stringstream approach is recommended. Where the conversions are -numeric to numeric, numeric_cast may offer more reasonable -behavior than lexical_cast. +numeric to numeric, numeric_cast +may offer more reasonable behavior than lexical_cast. +

+For a good discussion of the options and issues involved in string-based formatting, +including comparison of stringstream, lexical_cast, and +others, see Herb Sutter's article, +The String Formatters of Manor Farm.


@@ -154,12 +159,8 @@ template<typename Target, typename Source> Returns the result of streaming arg into a std::stringstream and then -out as a Target object. The conversion is parameterized by the current -lexical_context, if set. If the conversion is -unsuccessful, a bad_lexical_cast exception is thrown -if the current lexical_context is set for throwing or -if there is no current lexical_context set, otherwise a -Target() is returned. +out as a Target object. If the conversion is unsuccessful, a +bad_lexical_cast exception is thrown.

The requirements on the argument and result types are: