C++ Logo

std-proposals

Advanced search

Re: Proposal of constpub (DRAFT 1)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 14 Jan 2020 11:17:49 -0800
On Monday, 13 January 2020 20:06:48 PST connor horman via Std-Proposals wrote:
> I’d recommend having read/write properties return a reference, and
> potentially having read properties return a const reference, and otherwise
> be similar to methods (cv-qualifiers, ref-qualifiers, etc)

So long as that's a recommendation, not required, that's fine.

Because I recommend property getters always return by value, never a
reference. That allows you to change the internal implementation to hold
something different.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2020-01-14 13:20:26