mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
resolve #17, fix wrong description and example for constexpr
This commit is contained in:
@@ -38,7 +38,9 @@ int main() {
|
||||
// char arr_3[len]; // illegal
|
||||
|
||||
const int len_2 = len + 1;
|
||||
char arr_4[len_2]; // legal
|
||||
constexpr int len_2_constexpr = 1 + 2 + 3;
|
||||
// char arr_4[len_2]; // illegal, but ok for most of the compilers
|
||||
char arr_4[len_2_constexpr]; // legal
|
||||
|
||||
// char arr_5[len_foo()+5]; // illegal
|
||||
char arr_6[len_foo_constexpr() + 1]; // legal
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
all: $(patsubst %.cpp, %.out, $(wildcard *.cpp))
|
||||
|
||||
%.out: %.cpp Makefile
|
||||
clang++ $< -o $@ -std=c++17
|
||||
clang++ $< -o $@ -std=c++17 -pedantic
|
||||
|
||||
clean:
|
||||
rm *.out
|
||||
Reference in New Issue
Block a user