diff options
author | Brad King <brad.king@kitware.com> | 2019-08-26 14:30:58 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-26 10:31:15 -0400 |
commit | f5a7ae0c4bcfa90fb530d69f9277290c5f947db2 (patch) | |
tree | d9955bc2c992102093f309cab04e2cfeaf716f9d /bootstrap | |
parent | 4892f73d7428fbbe4bd11d4892590ec81eeff56b (diff) | |
parent | 197c5e12adea2b7d72cf8bfa17e961b9428f5d57 (diff) | |
download | cmake-f5a7ae0c4bcfa90fb530d69f9277290c5f947db2.tar.gz |
Merge topic 'optional'
197c5e12ad Source: Add cm::optional
170fcd715f Extend C++17 feature checks to require std::optional
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Merge-request: !3644
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1147,6 +1147,20 @@ int check_cxx14() } #endif +#if __cplusplus >= 201703L +#include <optional> +int check_cxx17() +{ + std::optional<int> oi = 0; + return oi.value(); +} +#else +int check_cxx17() +{ + return 0; +} +#endif + class Class { public: @@ -1157,7 +1171,7 @@ private: int main() { auto const c = std::unique_ptr<Class>(new Class); - std::cout << c->Get() << check_cxx14() << std::endl; + std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl; return 0; } ' > "${TMPFILE}.cxx" |