Why throw std::logic error ? I've placed 'using namespace std' directive
above .

 

  _____  

From: Ivan Sidarau [mailto:notifications@github.com] 
Sent: Sunday, November 03, 2013 1:34 PM
To: sidorovis/cpp_craft_1013
Cc: PeterMoroz
Subject: Re: [cpp_craft_1013] all previous tasks in one pull request (#132)

 

In solutions/peter_moroz/puzzles-1/sources/task-14/task-14.cpp:

> +void ReadCodes(ifstream& ifs, int& count, vector<double>& codes) {
> +  using namespace boost;
> +
> +  codes.clear();
> +  count = 0;
> +  string line;
> +  stringstream msg;
> +
> +  getline(ifs, line);
> +  try {
> +    count = lexical_cast<int>(line.c_str());
> +  } catch (bad_lexical_cast& ex) {
> +    msg << "boost::bad_lexical_cast has been caught "
> +        << "when " << line << " had been casted to int. "
> +        << "Details: " << ex.what();
> +    throw logic_error(msg.str());

throw std::logic_error( . );

-
Reply to this email directly or view
<https://github.com/sidorovis/cpp_craft_1013/pull/132/files#r7390444>  it on
GitHub.
<https://github.com/notifications/beacon/O7y4LvL-5wBGMo5Tflvq1m-4ZaL5V540nNJ
OdW5qhqShQxrRNzG5KVj-EtvAYB7R.gif>