summaryrefslogtreecommitdiffstats
path: root/Source/Checks
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-22 08:09:41 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-04-22 08:09:41 (GMT)
commit5d1671324bbcf0826b32c4c1691ae0f1041430ed (patch)
tree6f48e4257e0682770a83a5707efbe4fed65c3d2a /Source/Checks
parente9d1ca782ec8668681e2e88a6112af40409e5b50 (diff)
downloadCMake-5d1671324bbcf0826b32c4c1691ae0f1041430ed.zip
CMake-5d1671324bbcf0826b32c4c1691ae0f1041430ed.tar.gz
CMake-5d1671324bbcf0826b32c4c1691ae0f1041430ed.tar.bz2
cmConfigure: provide macros CM_EQ_DELETE and CM_DISABLE_COPY
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx_eq_delete.cxx14
-rw-r--r--Source/Checks/cm_cxx_features.cmake1
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_eq_delete.cxx b/Source/Checks/cm_cxx_eq_delete.cxx
new file mode 100644
index 0000000..809e4cf
--- /dev/null
+++ b/Source/Checks/cm_cxx_eq_delete.cxx
@@ -0,0 +1,14 @@
+struct Foo
+{
+ Foo() {}
+ ~Foo() {}
+ Foo(Foo const&) = delete;
+ Foo& operator=(Foo const&) = delete;
+ int test() const { return 0; }
+};
+
+int main()
+{
+ Foo const foo;
+ return foo.test();
+}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 80c9f3b..cd58539 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -33,6 +33,7 @@ endfunction()
if(CMAKE_CXX_STANDARD)
cm_check_cxx_feature(auto_ptr)
+ cm_check_cxx_feature(eq_delete)
cm_check_cxx_feature(make_unique)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)