mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
Merge topic 'check-std-size-cbegin-cend'
e6195989c7Merge branch 'backport-check-std-size-cbegin-cend'a605bf438eExtend C++17/C++14 feature checks to cover more standard library APIse17deb7ad4Extend C++17/C++14 feature checks to cover more standard library APIs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3030
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user