forked from boostorg/conversion
show arg as pased by const ref
[SVN r32840]
This commit is contained in:
@@ -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 &);
|
||||||
void log_message(const std::string &);
|
|
||||||
|
|
||||||
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>"boost/lexical_cast.hpp"</code></a>:
|
Library features defined in <a href="../../boost/lexical_cast.hpp"><code>"boost/lexical_cast.hpp"</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<typename Target, typename Source>
|
template<typename Target, typename Source>
|
||||||
Target <a href="#lexical_cast">lexical_cast</a>(Source arg);
|
Target <a href="#lexical_cast">lexical_cast</a>(const Source& arg);
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>Unit test defined in <a href="lexical_cast_test.cpp"><code>"lexical_cast_test.cpp"</code></a>.
|
</blockquote>Unit test defined in <a href="lexical_cast_test.cpp"><code>"lexical_cast_test.cpp"</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<typename Target, typename Source>
|
||||||
template<typename Target, typename Source>
|
Target lexical_cast(const Source& 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<typename Target, typename Source>
|
|||||||
<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>© Copyright Kevlin Henney, 2000–2005</i></small></div>
|
<div align="right"><small><i>© Copyright Kevlin Henney, 2000–2005</i></small></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Reference in New Issue
Block a user