
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org]On Behalf Of Jason Sent: vrijdag 16 juli 2004 11:03 To: boost@lists.boost.org Subject: [boost] lexical_cast reviewed
SOURCE CODE: #include <sstream> using namespace std;
class lexical_cast { public: template <typename Source> lexical_cast( const Source & source ) { ss << source; }
template <typename Target> operator Target() { Target target; ss >> target; return target; } private: stringstream ss; };
Not really lexical_cast, but useful nevertheless. Perhaps we could call it lexical_auto_cast. It could be more efficient to store a string instead, but I'm not sure. Regards, Michiel Salters This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.