summaryrefslogtreecommitdiffstats
path: root/Source/Checks/cm_cxx_make_unique.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-16 17:21:10 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-16 17:22:10 (GMT)
commitaa50cdac439121f9e40ff2638368dc913a0e2361 (patch)
treea69eb3c862b978dd6980cb7ffe1443d111ae7ae9 /Source/Checks/cm_cxx_make_unique.cxx
parent00fd64d1263901f96935e15c8d90ee8a338cee1a (diff)
downloadCMake-aa50cdac439121f9e40ff2638368dc913a0e2361.zip
CMake-aa50cdac439121f9e40ff2638368dc913a0e2361.tar.gz
CMake-aa50cdac439121f9e40ff2638368dc913a0e2361.tar.bz2
Check for availability of unique_ptr and make_unique when building CMake
Some code paths may find these useful if available.
Diffstat (limited to 'Source/Checks/cm_cxx_make_unique.cxx')
-rw-r--r--Source/Checks/cm_cxx_make_unique.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_make_unique.cxx b/Source/Checks/cm_cxx_make_unique.cxx
new file mode 100644
index 0000000..a3ff68f
--- /dev/null
+++ b/Source/Checks/cm_cxx_make_unique.cxx
@@ -0,0 +1,6 @@
+#include <memory>
+int main()
+{
+ std::unique_ptr<int> u = std::make_unique<int>(0);
+ return *u;
+}