From edf13aabc0ea4b66adfae58d372a20f0b42b3b25 Mon Sep 17 00:00:00 2001 From: beinhaerter <34543625+beinhaerter@users.noreply.github.com> Date: Mon, 26 Mar 2018 20:12:03 +0200 Subject: [PATCH] Note that C.46 does not apply for copy/move ctors (#1169) * Note that C.46 does not apply for copy/move ctors * moved Note section before Enforcement section --- CppCoreGuidelines.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 27a9a1e..ee04a0c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5330,6 +5330,10 @@ If you really want an implicit conversion from the constructor argument type to **See also**: [Discussion of implicit conversions](#Ro-conversion) +##### Note + +Copy and move constructors should not be made explicit because they do not perform conversions. Explicit copy/move constructors make passing and returning by value difficult. + ##### Enforcement (Simple) Single-argument constructors should be declared `explicit`. Good single argument non-`explicit` constructors are rare in most code based. Warn for all that are not on a "positive list".