vrshoot
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/assimp/boost/lexical_cast.hpp Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,24 @@ 1.4 +/// A quick replacement for boost::lexical_cast for all the Boost haters out there 1.5 + 1.6 +#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST 1.7 +#define __AI_BOOST_WORKAROUND_LEXICAL_CAST 1.8 + 1.9 +namespace boost 1.10 +{ 1.11 + 1.12 + /// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle 1.13 + template <typename TargetType, typename SourceType> 1.14 + TargetType lexical_cast( const SourceType& source) 1.15 + { 1.16 + std::stringstream stream; 1.17 + TargetType result; 1.18 + 1.19 + stream << source; 1.20 + stream >> result; 1.21 + return result; 1.22 + } 1.23 + 1.24 +} // namespace boost 1.25 + 1.26 +#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST 1.27 +