CppCoreGuidelines icon indicating copy to clipboard operation
CppCoreGuidelines copied to clipboard

R.34-R.36 need clarification

Open BjarneStroustrup opened this issue 4 years ago • 3 comments

I think we need an explanation of why we might want to define such "might" functions.

BjarneStroustrup avatar Feb 27 '21 19:02 BjarneStroustrup

It seems you meant R.34-R.36.

JohelEGP avatar Feb 27 '21 19:02 JohelEGP

I did. Thanks.

BjarneStroustrup avatar Feb 27 '21 19:02 BjarneStroustrup

What should an example for R.36 (passing const shared_ptr<T>&) show? Should it conditioanally take ownership? Would passing by const ref violate F.15 (prefer simple passing)?

bgloyer avatar Aug 09 '21 00:08 bgloyer