forked from LearningInfiniTensor/learning-cxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise.h
19 lines (16 loc) · 1.17 KB
/
exercise.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef __EXERCISE_H__
#define __EXERCISE_H__
#include <iostream>
#define ASSERT(COND, MSG) \
if (!(COND)) { \
std::cerr << "\x1b[31mAssertion failed at line #" << __LINE__ << ": \x1b[0m" << std::endl \
<< std::endl \
<< #COND << std::endl \
<< std::endl \
<< "\x1b[34mMessage:\x1b[0m" << std::endl \
<< std::endl \
<< MSG << std::endl \
<< std::endl; \
exit(1); \
}
#endif// __EXERCISE_H__