Hacker News new | ask | show | jobs
by codr7 821 days ago
Why would you prefer that over:

  throw exceptionC("error code: ", t);
?

Ever since perfect forwarding I've been using this pattern to get out of arrow hell:

  template <typename Arg, typename...Args>
  string to_string(Arg &&arg, Args &&...args) {
    stringstream buf;
    buf << arg;
    ((buf << std::forward<Args>(args)), ...);
    return buf.str();
  }