vrshoot

view libs/assimp/boost/lexical_cast.hpp @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 /// A quick replacement for boost::lexical_cast for all the Boost haters out there
3 #ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST
4 #define __AI_BOOST_WORKAROUND_LEXICAL_CAST
6 namespace boost
7 {
9 /// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle
10 template <typename TargetType, typename SourceType>
11 TargetType lexical_cast( const SourceType& source)
12 {
13 std::stringstream stream;
14 TargetType result;
16 stream << source;
17 stream >> result;
18 return result;
19 }
21 } // namespace boost
23 #endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST