#ifndef CHECK_HH #define CHECK_HH #include #include #include namespace check { template requires std::is_arithmetic_v T add(T a, T b) { T ret; if (ckd_add(&ret, a, b)) abort(); return ret; } template requires std::is_arithmetic_v T sub(T a, T b) { T ret; if (ckd_sub(&ret, a, b)) abort(); return ret; } template requires std::is_arithmetic_v T mul(T a, T b) { T ret; if (ckd_mul(&ret, a, b)) abort(); return ret; } } // namespace check #endif // CHECK_HH