[LLVMdev] RFC: variable names

Xinliang David Li xinliangli at gmail.com
Mon Oct 13 21:49:21 PDT 2014


On Mon, Oct 13, 2014 at 8:07 PM, Chandler Carruth <chandlerc at google.com>
wrote:

>
> On Mon, Oct 13, 2014 at 8:07 PM, Xinliang David Li <xinliangli at gmail.com>
> wrote:
>
>> For lambdas, you have more contexts to confuse yourself, so why would a
>> discriminator like '_' not be helpful here?
>
>
> Because you cannot attach such a discriminator to the members of the
> lambda struct. Their names are automatically selected based on capture.
>

members of lambda struct? Is this a developer's view or a C++ user's view ?

For member variable access in lamdas, it is 'this' that is captured. If I
see reference of 'x_', I will know it is actually 'this-x_' even in lamdas.
Am I missing something?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/c8ec61fb/attachment.html>


More information about the llvm-dev mailing list