[Cmake-commits] CMake branch, master, updated. v3.8.0-951-g0085701
Kitware Robot
kwrobot at kitware.com
Tue Apr 25 16:45:03 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 008570150ccd23bbaa42d7543e49fbfa5d28ade4 (commit)
via d0b70e676e286cfa7fe1b72cafdf5f704e1038d2 (commit)
from 74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=008570150ccd23bbaa42d7543e49fbfa5d28ade4
commit 008570150ccd23bbaa42d7543e49fbfa5d28ade4
Merge: 74672e2 d0b70e6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 25 20:41:07 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 25 16:41:13 2017 -0400
Merge topic 'doc-eq-delete'
d0b70e67 Help/dev: Document CM_EQ_DELETE and CM_DISABLE_COPY
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !755
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0b70e676e286cfa7fe1b72cafdf5f704e1038d2
commit d0b70e676e286cfa7fe1b72cafdf5f704e1038d2
Author: Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Mon Apr 24 23:36:05 2017 +0200
Commit: Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Tue Apr 25 22:08:47 2017 +0200
Help/dev: Document CM_EQ_DELETE and CM_DISABLE_COPY
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 3ac9aca..7e44995 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -34,6 +34,24 @@ need to be handled with care:
warnings about deprecated interfaces in general. Use the ``CM_AUTO_PTR``
macro instead.
+* Use ``CM_EQ_DELETE;`` instead of ``= delete;``.
+
+ Defining functions as *deleted* is not supported in C++98. Using
+ ``CM_EQ_DELETE`` will delete the functions if the compiler supports it and
+ give them no implementation otherwise. Calling such a function will lead
+ to compiler errors if the compiler supports *deleted* functions and linker
+ errors otherwise.
+
+* Use ``CM_DISABLE_COPY(Class)`` to mark classes as non-copyable.
+
+ The ``CM_DISABLE_COPY`` macro should be used in the private section of a
+ class to make sure that attempts to copy or assign an instance of the class
+ lead to compiler errors even if the compiler does not support *deleted*
+ functions. As a guideline, all polymorphic classes should be made
+ non-copyable in order to avoid slicing. Classes that are composed of or
+ derived from non-copyable classes must also be made non-copyable explicitly
+ with ``CM_DISABLE_COPY``.
+
* Use ``size_t`` instead of ``std::size_t``.
Various implementations have differing implementation of ``size_t``.
-----------------------------------------------------------------------
Summary of changes:
Help/dev/source.rst | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list