1 #ifndef __throwcall_h__
2 #define __throwcall_h__
22 #include <system_error>
26 template <
typename T>
void conCatString(std::ostringstream& msg,
const T& begin) {
29 template <
typename T,
typename ... Args>
inline void conCatString(std::ostringstream& msg,
31 const Args& ... args) {
33 if (
sizeof...(args)) {
40 template <
typename T,
typename ... Args>
inline void good0(T call,
const Args& ... args) {
41 if (__builtin_expect(call, 0)) {
42 std::ostringstream msg;
44 throw std::system_error(errno, std::system_category(), msg.str());
54 template <
typename T,
typename t,
typename ... Args>
inline T
badval(T call, t badvalue,
const Args& ... args) {
55 if (__builtin_expect(call == badvalue,
false)) {
56 std::ostringstream msg;
58 throw std::system_error(errno, std::system_category(), msg.str());