vrshoot
view libs/assimp/boost/lexical_cast.hpp @ 2:334d17aed7de
visual studio project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Feb 2014 18:36:38 +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