diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Checks/cm_cxx14_check.cpp | 9 | ||||
-rw-r--r-- | Source/Checks/cm_cxx17_check.cpp | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/Source/Checks/cm_cxx14_check.cpp b/Source/Checks/cm_cxx14_check.cpp index 9369ba2..fff36c9 100644 --- a/Source/Checks/cm_cxx14_check.cpp +++ b/Source/Checks/cm_cxx14_check.cpp @@ -1,8 +1,15 @@ #include <cstdio> +#include <iterator> #include <memory> int main() { + int a[] = { 0, 1, 2 }; + auto ai = std::cbegin(a); + + int b[] = { 2, 1, 0 }; + auto bi = std::cend(b); + std::unique_ptr<int> u(new int(0)); - return *u; + return *u + *ai + *(bi - 1); } diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp index 2de10d6..593d9b2 100644 --- a/Source/Checks/cm_cxx17_check.cpp +++ b/Source/Checks/cm_cxx17_check.cpp @@ -1,4 +1,5 @@ #include <cstdio> +#include <iterator> #include <memory> #include <unordered_map> @@ -8,6 +9,14 @@ int main() { + int a[] = { 0, 1, 2 }; + auto ai = std::cbegin(a); + + int b[] = { 2, 1, 0 }; + auto bi = std::cend(b); + + auto ci = std::size(a); + std::unique_ptr<int> u(new int(0)); #ifdef _MSC_VER @@ -18,5 +27,5 @@ int main() IDispatchPtr disp(ptr); #endif - return *u; + return *u + *ai + *(bi - 1) + (3 - static_cast<int>(ci)); } |