[cfe-dev] C++11 reverse iterators (was C++11 is here)
Chris Lattner
sabre at nondot.org
Mon Mar 3 16:42:16 PST 2014
On Mar 3, 2014, at 10:29 AM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Mon, Mar 3, 2014 at 9:48 AM, Chris Lattner <sabre at nondot.org> wrote:
>> In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading
>
> It's getting the range though, just like Function::getArgumentList() returns the argument list.
>
> I really disagree (and I disagree with getArgumentList for the same reason).
>
> getFoo should return something with value semantics (even if its a const reference to delay the copy). setFoo should directly mutate something.
>
> What we're really doing is making the equivalent of a "member-like accessor" method.
Ok, can this be generalized into guidance we can put in the coding standards?
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140303/2e0bb6ab/attachment.html>
More information about the cfe-dev
mailing list