Hacker News new | past | comments | ask | show | jobs | submit login

Why using boost is overkill? You use std::XXX and the STL, do you consider these too? For the two cases you mentioned, boost comes with nice functions to solve them (lexical_cast, which uses stringstream and the boost tokenizer).

  tokenizer<> tok(s);
   for(tokenizer<>::iterator beg=tok.begin();beg!=tok.end();++beg){
       cout << *beg << "\n";
   }
It surely beats the C approach of handling pointers my hand, or the ugly interface of strtok / strtoX (X=l,d,etc). At least in C++ you can use the same function for any number type.

I see the need of C (or ASM), but with char/string manipulation it loses any battle with any other language, except probably speed.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: