diff --git a/example/crc32/crc32.cc b/example/crc32/crc32.cc index 49f4a096..e0e3261d 100644 --- a/example/crc32/crc32.cc +++ b/example/crc32/crc32.cc @@ -27,6 +27,10 @@ $CXX crc32.cc && ./a.out < ../../README.md; rm -f a.out for a C++ compiler $CXX, such as clang++ or g++. */ +#if defined(__cplusplus) && (__cplusplus < 201103L) +#error "This C++ program requires -std=c++11 or later" +#endif + #include #include #include diff --git a/example/jsonfindptrs/jsonfindptrs.cc b/example/jsonfindptrs/jsonfindptrs.cc index ad5cf8df..c6e506dc 100644 --- a/example/jsonfindptrs/jsonfindptrs.cc +++ b/example/jsonfindptrs/jsonfindptrs.cc @@ -57,6 +57,10 @@ $CXX jsonfindptrs.cc && ./a.out < ../../test/data/github-tags.json; rm -f a.out for a C++ compiler $CXX, such as clang++ or g++. */ +#if defined(__cplusplus) && (__cplusplus < 201103L) +#error "This C++ program requires -std=c++11 or later" +#endif + #include #include #include diff --git a/example/jsonptr/jsonptr.cc b/example/jsonptr/jsonptr.cc index 58d21566..f5d72aba 100644 --- a/example/jsonptr/jsonptr.cc +++ b/example/jsonptr/jsonptr.cc @@ -94,6 +94,10 @@ $CXX jsonptr.cc && ./a.out < ../../test/data/github-tags.json; rm -f a.out for a C++ compiler $CXX, such as clang++ or g++. */ +#if defined(__cplusplus) && (__cplusplus < 201103L) +#error "This C++ program requires -std=c++11 or later" +#endif + #include #include #include