[lexical_cast] doc update

I'm going to commit to HEAD two new sections 'Frequently Asked Questions' and 'References' and also update 'Changes' section. Any objections, corrections etc? New documentation is here http://194.6.223.221/~nasonov/lexical_cast.htm Frequently Asked Questions Q: Why lexical_cast<int8_t>("127") throws bad_lexical_cast? A: The type int8_t is a typedef to char or signed char. Lexical conversion to these types is simply reading a byte from source but since the source has more than one byte, the exception is thrown. Please use other integer types such as int or short int. If bounds check is important, you can also call numeric_cast: numeric_cast<int8_t>(lexical_cast<int>("127")); Q: The implementation always resets the ios_base::skipws flag of an underlying stream object. It breaks my operator>> that works only in presence of this flag. Can you remove code that resets the flag? A: May be in a future version. The is no requirement in [N1973] to reset the flag but remember that [N1973] is not yet accepted by the commitee. By the way, it's a greate opportunity to make your operator>> conform to the standard. Read a good C++ book, study std::sentry and ios_state_saver. References * [N1973] Kevlin Henney, Beman Dawes, Lexical Conversion Library * Proposal for TR2, N1973. * [Tuning] Alexander Nasonov, Fine Tuning for lexical_cast, * Overload #74, August 2006. Changes August, October 2006: * Better performance for many combinations of Source and Target * types. Refer to [Tuning] for more details. -- Alexander Nasonov http://nasonov.blogspot.com

I'm going to commit to HEAD two new sections 'Frequently Asked Questions' and 'References' and also update 'Changes' section. Any objections, corrections etc?
Just noticed what look like a couple of missing links [tuning] for example, and was [N1973] supposed to be a quickbook template that links to the doc? There may be a couple of others as well. Otherwise looks fine to me. John.

I'm going to commit to HEAD two new sections 'Frequently Asked Questions' and 'References' and also update 'Changes' section.
I suggest also mentioning the problem with [u]int8_t casting _to_ a string. Suggested wording (if after the FAQ about the opposite conversion): Q: What does lexical_cast<string> of an int8_t or uint8_t not do what I expect? A: As above, note that int8_t and uint8_t are actually chars and are formatted as such. To avoid this, cast to an integer type first: lexical_cast<string>(static_cast<int>(n)). Following are some minor edits to your text: Q: Why does lexical_cast<int8_t>("127") throw bad_lexical_cast? commitee --> committee greate --> great Phil.

Phil Endecott wrote:
... Q: What does lexical_cast<string> of an int8_t or uint8_t not do what I expect? A: As above, note that int8_t and uint8_t are actually chars and are formatted as such. To avoid this, cast to an integer type first: lexical_cast<string>(static_cast<int>(n)).
Actually, you can write it a bit shorter: lexical_cast<string>(+n) ;-) New revision is available at http://194.6.223.221/~nasonov/lexical_cast.htm -- Alexander Nasonov http://nasonov.blogspot.com The greater our knowledge increases the more our ignorance unfolds. -- John F. Kennedy -- This quote is generated by: /usr/pkg/bin/curl -L http://tinyurl.com/veusy \ | sed -e 's/^document\.write(.//' -e 's/.);$/ --/' \ -e 's/<[^>]*>//g' -e 's/^More quotes from //' \ | fmt | tee ~/.signature-quote

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Alexander Nasonov Sent: 15 May 2007 22:36 To: Boost developers list Cc: Kevlin Henney Subject: [boost] [lexical_cast] doc update
I'm going to commit to HEAD two new sections 'Frequently Asked Questions' and 'References' and also update 'Changes' section. Any objections, corrections etc?
New documentation is here http://194.6.223.221/~nasonov/lexical_cast.htm
At a glance, it looks OK to me. Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com
participants (5)
-
Alexander Nasonov
-
Gregory Dai
-
John Maddock
-
Paul A Bristow
-
Phil Endecott