show arg as pased by const ref

[SVN r32840]
This commit is contained in:
Beman Dawes
2006-02-12 01:17:17 +00:00
parent e5a0aec661
commit 17ca3a4493

View File

@@ -4,7 +4,7 @@
<head> <head>
<title>lexical_cast</title> <title>lexical_cast</title>
<meta name="author" content="Kevlin Henney, mailto:kevlin@curbralan.com"> <meta name="author" content="Kevlin Henney, mailto:kevlin@curbralan.com">
<meta name="generator" content="Microsoft FrontPage 4.0"> <meta name="generator" content="Microsoft FrontPage 5.0">
</head> </head>
<body bgcolor="#FFFFFF" text="#000000"> <body bgcolor="#FFFFFF" text="#000000">
<h1><img src="../../boost.png" alt="boost.png (6897 bytes)" align="center" width="277" height="86">Header <h1><img src="../../boost.png" alt="boost.png (6897 bytes)" align="center" width="277" height="86">Header
@@ -89,8 +89,7 @@
<h2><a name="examples">Examples</a></h2> <h2><a name="examples">Examples</a></h2>
The following example treats command line arguments as a sequence of numeric The following example treats command line arguments as a sequence of numeric
data: <blockquote> data: <blockquote>
<pre> <pre>int main(int argc, char * argv[])
int main(int argc, char * argv[])
{ {
using boost::lexical_cast; using boost::lexical_cast;
using boost::bad_lexical_cast; using boost::bad_lexical_cast;
@@ -112,8 +111,7 @@ int main(int argc, char * argv[])
} }
</pre> </pre>
</blockquote>The following example uses numeric data in a string expression: <blockquote> </blockquote>The following example uses numeric data in a string expression: <blockquote>
<pre> <pre>void log_message(const std::string &amp;);
void log_message(const std::string &amp;);
void log_errno(int yoko) void log_errno(int yoko)
{ {
@@ -125,12 +123,11 @@ void log_errno(int yoko)
<h2><a name="synopsis">Synopsis</a></h2> <h2><a name="synopsis">Synopsis</a></h2>
Library features defined in <a href="../../boost/lexical_cast.hpp"><code>&quot;boost/lexical_cast.hpp&quot;</code></a>: Library features defined in <a href="../../boost/lexical_cast.hpp"><code>&quot;boost/lexical_cast.hpp&quot;</code></a>:
<blockquote> <blockquote>
<pre> <pre>namespace boost
namespace boost
{ {
class <a href="#bad_lexical_cast">bad_lexical_cast</a>; class <a href="#bad_lexical_cast">bad_lexical_cast</a>;
template&lt;typename Target, typename Source&gt; template&lt;typename Target, typename Source&gt;
Target <a href="#lexical_cast">lexical_cast</a>(Source arg); Target <a href="#lexical_cast">lexical_cast</a>(const Source&amp; arg);
} }
</pre> </pre>
</blockquote>Unit test defined in <a href="lexical_cast_test.cpp"><code>&quot;lexical_cast_test.cpp&quot;</code></a>. </blockquote>Unit test defined in <a href="lexical_cast_test.cpp"><code>&quot;lexical_cast_test.cpp&quot;</code></a>.
@@ -138,9 +135,8 @@ namespace boost
<hr> <hr>
<h2><a name="lexical_cast"><code>lexical_cast</code></a></h2> <h2><a name="lexical_cast"><code>lexical_cast</code></a></h2>
<blockquote> <blockquote>
<pre> <pre>template&lt;typename Target, typename Source&gt;
template&lt;typename Target, typename Source&gt; Target lexical_cast(const Source&amp; arg);
Target lexical_cast(Source arg);
</pre> </pre>
</blockquote>Returns the result of streaming <code>arg</code> into a </blockquote>Returns the result of streaming <code>arg</code> into a
standard library string-based stream and then out as a <code>Target</code> object. standard library string-based stream and then out as a <code>Target</code> object.
@@ -186,8 +182,7 @@ template&lt;typename Target, typename Source&gt;
<hr> <hr>
<h2><a name="bad_lexical_cast"><code>bad_lexical_cast</code></a></h2> <h2><a name="bad_lexical_cast"><code>bad_lexical_cast</code></a></h2>
<blockquote> <blockquote>
<pre> <pre>class bad_lexical_cast : public std::bad_cast
class bad_lexical_cast : public std::bad_cast
{ {
public: public:
... // <i>same member function interface as</i> std::exception ... // <i>same member function interface as</i> std::exception
@@ -236,4 +231,4 @@ public:
<div align="right"><small><i>&copy; Copyright Kevlin Henney, 2000&#150;2005</i></small></div> <div align="right"><small><i>&copy; Copyright Kevlin Henney, 2000&#150;2005</i></small></div>
</body> </body>
</html> </html>