lexical_cast on the pocket pc

Hi, I've written a functor (primarily for use with a std::map<string, ?>) that sorts numerically first and alphabetically second using lexical_cast. It looks like this: try { return lexical_cast<double>(lhs) < lexical_cast<double>(rhs); } catch (bad_lexical_cast&) { return lhs < rhs; } ...and it's been working nicely so far. However on the Pocket PC, each time an exception is raised by the lexical_cast, it takes about a quarter of a second to move on to the catch. Not very nice when the map is huge. As far as I can tell, there is no way to say to ensure that a lexical_cast is going to be valid until you actually perform it. I'm hoping that I won't need to resort to duplicating the innards of lexical_cast in order to implement this function on the Pocket PC. Any ideas? Thanks all, Matt. ------------------------------------------------------------------------ -------- Big Bucket Amusement http://members.iinet.net.au/~mattcomi/mt/bigbucket
participants (1)
-
Matt Comi