Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

(maint) C++ Style Cleanup #419

Merged
merged 2 commits into from
May 7, 2016

Conversation

MikaelSmith
Copy link
Contributor

(maint) Default to pass constructor arguments by value
(maint) Fix minor issues from i18n work

Restore a formatting argument, and update messages for a typo fix.
When passing arguments to a constructor that will be stored directly
into the object, pass by value. This allows move semantics while not
incurring any overhead if we need to create a copy (the copy will be
created on constructor invocation rather than in the constructor). This
requires that the argument is then std::moved into the object storage.

In most other cases, preserve pass-by-reference.

See
https://github.com/puppetlabs/cppbestpractices/blob/master/03-FAQ.md#q-arguments-and-return-types-in-class-methods
@parisiale parisiale merged commit 55b79dc into puppetlabs-toy-chest:master May 7, 2016
@MikaelSmith MikaelSmith deleted the cpp-cleanup branch May 9, 2016 16:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants