Slow and unsafe code
30 Oct 11, 9:41PM
Slow and unsafe code
1) It is not necessary to precompute how many fields there are in the string. You can just append to the vector as you are going along.<p>
2) What happens if some fields cannot be converted to a double (e.g. empty fields)?<p>
3) Returning vectors by value is inefficient for C++03. For more modern c++, you can use boost::spirit with simpler and much much faster code.
Login