[bind10-dev] Shared pointers, references and guideline

Michal 'vorner' Vaner michal.vaner at nic.cz
Fri May 31 07:10:39 UTC 2013


Hello

On Thu, May 30, 2013 at 12:38:34PM -0700, JINMEI Tatuya / 神明達哉 wrote:
> I remember the discussion but I don't remember agreed consensus for
> the guideline.

Hmm. I'm following the rule quite a lot ‒ if there's something that can be
passed as const reference instead of value and it is not primitive small object
(bare pointer, integer), I use const reference (not omitting the shared
pointers).

With creating, I believe these were the constructors (including
copy-constructors) and destructors of the shared pointer itself, not the
destructors called from them. I guess the difference between calling and not
calling the destructor is small (if the destructor itself is not included in the
cost of the function).

I agree we should prefer a bare (const) reference if possible.

My apologies to you, Paul, if I persuaded you to follow a rule only I believed
existed.

With regards

-- 
Anyone who goes to a psychiatrist ought to have his head examined.
		-- Samuel Goldwyn

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20130531/c9bd76ce/attachment.bin>


More information about the bind10-dev mailing list