mirror of
https://github.com/boostorg/conversion.git
synced 2026-08-06 13:34:14 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 41de6433bf |
@@ -13,18 +13,11 @@
|
||||
// where: tested with MSVC 6.0, BCC 5.5, and g++ 2.91
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// The GNU sstream implementation is broken for the purposes of lexical cast.
|
||||
# if defined(BOOST_NO_STRINGSTREAM) || (defined(__GNUC__) && !defined(__STL_USE_NEW_IOSTREAMS) || defined(__APPLE_CC__))
|
||||
# define BOOST_LEXICAL_CAST_USE_STRSTREAM
|
||||
# ifndef BOOST_NO_STRINGSTREAM
|
||||
# include <sstream>
|
||||
# else
|
||||
# include <strstream>
|
||||
# endif
|
||||
|
||||
#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
|
||||
# include <strstream>
|
||||
#else
|
||||
# include <sstream>
|
||||
#endif
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
@@ -46,10 +39,10 @@ namespace boost
|
||||
template<typename Target, typename Source>
|
||||
Target lexical_cast(Source arg)
|
||||
{
|
||||
# ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
|
||||
std::strstream interpreter; // for out-of-the-box g++ 2.95.2
|
||||
# else
|
||||
# ifndef BOOST_NO_STRINGSTREAM
|
||||
std::stringstream interpreter;
|
||||
# else
|
||||
std::strstream interpreter; // for out-of-the-box g++ 2.95.2
|
||||
# endif
|
||||
Target result;
|
||||
|
||||
@@ -71,8 +64,4 @@ namespace boost
|
||||
//
|
||||
// This software is provided "as is" without express or implied warranty.
|
||||
|
||||
#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
|
||||
# undef BOOST_LEXICAL_CAST_USE_STRSTREAM
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+7
-7
@@ -12,13 +12,13 @@
|
||||
<a href="../../boost/lexical_cast.hpp">boost/lexical_cast.hpp</a></h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="#motivation">Motivation</a></li>
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
<li><a href="#synopsis">Synopsis</a></li>
|
||||
<li><a href="#lexical_cast"><code>lexical_cast</code></a></li>
|
||||
<li><a href="#bad_lexical_cast"><code>bad_lexical_cast</code></a></li>
|
||||
<li><a href="#portability">Portability</a></li>
|
||||
<li><a href="#future">Future directions</a></li>
|
||||
<li><a href="#motivation">Motivation</li>
|
||||
<li></a><a href="#examples">Examples</li>
|
||||
<li></a><a href="#synopsis">Synopsis</li>
|
||||
<li></a><a href="#lexical_cast"><code>lexical_cast</code></li>
|
||||
<li></a><a href="#bad_lexical_cast"><code>bad_lexical_cast</code></li>
|
||||
<li></a><a href="#portability">Portability</li>
|
||||
<li></a><a href="#future">Future directions</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user