#ifndef UTILS_H #define UTILS_H #include #include #include template int check(int rc) { if (rc < 0) { char *err = strerror(errno); std::string msg(err); throw T(msg); } return rc; } #endif // UTILS_H