Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define check_error(f, ...) _check_error(#f, f, __VA_ARGS__)
- template<typename Func, typename... Args>
- void _check_error(const std::string& funcName, Func func, Args... args) {
- auto is_success= func(args...);
- if (is_success) {
- // success handling
- }
- else {
- // error handling
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement