
28 Jan
2008
28 Jan
'08
4:46 p.m.
On 28/01/2008, Chengyuan Ma <chengyuan_ma@hotmail.com> wrote:
What's the best way to load the data? I use Boost::RegEx and Boost::lexical_cast to do this. But It takes 2 minutes to read all the data. Is there a better way to do this?
How about a spirit parser? I don't know spirit, but it'd be something like this: bool parse_numbers(istreambuf_iterator<char> s, map<unsigned, double> &m) { unsigned k; double d; return parse(s, ( *( ( uint_p[assign_a(k)] >> ':' >> real_p[assign_a(d) )[insert_at_a(m,k,d)] ) ) >> end_p , space_p).full; } ~ Scott