1 parent 686cb2e commit 1a49825Copy full SHA for 1a49825
1 file changed
section1/compile.cpp
@@ -7,7 +7,10 @@
7
//
8
// gcc -E -dM - < /dev/null
9
10
+#include <cassert>
11
+
12
#include <typeinfo>
13
+#include <string>
14
#include <iostream>
15
#include <stdexcept>
16
#include <type_traits>
@@ -107,6 +110,18 @@ void check_type(T v)
107
110
cout << is_void<void>::value << endl;
108
111
}
109
112
113
+void case5()
114
+{
115
+ int i = 10;
116
+ int *p = &i;
117
118
+ assert(i > 0 && "i must be greater than zero");
119
+ assert(p != nullptr);
120
121
+ std::string str = "hello";
122
+ assert(!str.empty());
123
+}
124
125
int main()
126
{
127
using namespace std;
@@ -123,6 +138,7 @@ int main()
138
case3();
139
140
case4();
141
+ case5();
142
143
check_type(10);
128
144
//check_type((void*)0);
0 commit comments