Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80377 - trunk/libs/conversion/doc
From: antoshkka_at_[hidden]
Date: 2012-09-03 13:23:17


Author: apolukhin
Date: 2012-09-03 13:23:16 EDT (Mon, 03 Sep 2012)
New Revision: 80377
URL: http://svn.boost.org/trac/boost/changeset/80377

Log:
Replace .c_str() with .data() in documentation (refs #6663)
Text files modified:
   trunk/libs/conversion/doc/lexical_cast.qbk | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/libs/conversion/doc/lexical_cast.qbk
==============================================================================
--- trunk/libs/conversion/doc/lexical_cast.qbk (original)
+++ trunk/libs/conversion/doc/lexical_cast.qbk 2012-09-03 13:23:16 EDT (Mon, 03 Sep 2012)
@@ -83,7 +83,7 @@
 ``
 int convert_strings_part(const std::string& s, std::size_t pos, std::size_t n)
 {
- return boost::lexical_cast<int>(s.c_str() + pos, n);
+ return boost::lexical_cast<int>(s.data() + pos, n);
 }
 ``
 [endsect]
@@ -267,7 +267,7 @@
 ]
 
 * [*Question:] What is the fastest way to convert a non zero terminated string or a substring using `boost::lexical_cast`?
- * [*Answer:] Use `boost::iterator_range` for conversion or `lexical_cast` overload with two parameters. For example, if you whant to convert to `int` two characters from a string `str`, you shall write `lexical_cast<int>(make_iterator_range(str.c_str(), str.c_str() + 2));` or `lexical_cast<int>(str.c_str(), 2);`.
+ * [*Answer:] Use `boost::iterator_range` for conversion or `lexical_cast` overload with two parameters. For example, if you whant to convert to `int` two characters from a string `str`, you shall write `lexical_cast<int>(make_iterator_range(str.data(), str.data() + 2));` or `lexical_cast<int>(str.data(), 2);`.
 
 [endsect]
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk