220 10942 <CAFk2RUadrMZHfeLsiHYSsAoro=QpJoies2swovmesa3w=oWGmQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Protect Lambda functions against reflection
Date: Thu, 29 May 2014 02:27:11 +0300
Lines: 37
Approved: news@gmane.org
Message-ID: <CAFk2RUadrMZHfeLsiHYSsAoro=QpJoies2swovmesa3w=oWGmQ@mail.gmail.com>
References: <108c47a2-d952-4f84-a347-923b2ab742ad@isocpp.org>
	<CAFk2RUaPcXONmVug7-_t+imouCVQv9LQ3Hos-yRo=0X-HBQZKQ@mail.gmail.com>
	<CAB+4KHL3MvqYR3s=grM7t8imKHmnjj8s4PAYO01Z+rtq8sivnw@mail.gmail.com>
	<CAFk2RUasQdm4U+w393wqaD-J_6km+xOHhmd_sRyBx7ESy5Eyjw@mail.gmail.com>
	<CAB+4KH+eoF=PcS1pTg+neNA60bcbyZZXJsUenud4Md5RAk+MKw@mail.gmail.com>
	<CAFk2RUacOGaupA6+4JnYMt9ADv4vLOnXL6Ye4ef6crmOB7p78w@mail.gmail.com>
	<CAB+4KHJa1_OoQ5fevDztHYUJDz=uoW5BgzOAiNX19ArNyQhCvg@mail.gmail.com>
	<CAFk2RUbRbXCCETeD=PC3yCHJSigqiCqaCYM8NUx57tugnw4m7w@mail.gmail.com>
	<CANh-dXm+2BcZr-2mcoK_sjOnPgZoczN29A1ZBxQ5xvnOpnwL0A@mail.gmail.com>
	<CAB+4KHJJG=M7PbGJrconmROoOSJPt3hK7CpnD9BWYeSOrEUTXA@mail.gmail.com>
	<7ef3d3da-0c1d-443c-88d2-656b91937170@isocpp.org>
	<68f98b78-8bd4-48e0-9e1d-47cfc0492764@isocpp.org>
	<CANh-dXkeX2SSJ7ZEdnOOm2ZnN-WcgbxYBmODiLtp0T4vpzF1rg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1401319640 17165 80.91.229.3 (28 May 2014 23:27:20 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 28 May 2014 23:27:20 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBUHBTGOAKGQEY7M6NDA@isocpp.org Thu May 29 01:27:13 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBUHBTGOAKGQEY7M6NDA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f72.google.com ([209.85.213.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBUHBTGOAKGQEY7M6NDA@isocpp.org>)
	id 1WpnFZ-0008Bf-AO
	for gclcip-std-proposals@m.gmane.org; Thu, 29 May 2014 01:27:13 +0200
Original-Received: by mail-yh0-f72.google.com with SMTP id f73sf50229404yha.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 May 2014 16:27:12 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=N1yfVKX2RWAnhjPOO6llvgTvi/S2lFLM9UdsGx0hOAo=;
        b=JVBVPxwtrRi2lUgkPmvvhFlgXDMYOtDdGvTSNFPIxk/LY4E05y+ywnXHOKt8EyV7cO
         pmTeI8B7sThQBqMjtVZqbEVYQZlaA6Oa11L/T4Q9N+HnVMWP/NJ1pcpL3HQRq5DyANKn
         xSBefG2F3rlK3TrRrmrVnkUeHc2/RDc+Er1cDj8Tf+3u0gpSoefHPCX+8knvl0OzTF8N
         e2BeDbbsAomDf66GOtqssZk03/CX6mlxJo7wvoOTNNiDRHfB1UQ25nNYqn4BDmuFJul8
         8nCmWU3CMepP1E8E9/7pSJKWwwZT4p6LsZGZpXADKeYNXknU2ODcbpmrirUobTW1BXIz
         lzNQ==
X-Gm-Message-State: ALoCoQmK2d8Hu/MrCPkcNNVPWBuMw6qWf3sCvrmbvTLEFBxgIAlpph3oAIbXvDrAf4rjL/FzOCI6
X-Received: by 10.58.25.99 with SMTP id b3mr1474930veg.28.1401319632341;
        Wed, 28 May 2014 16:27:12 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.102.180 with SMTP id w49ls335513qge.3.gmail; Wed, 28 May
 2014 16:27:11 -0700 (PDT)
X-Received: by 10.224.67.201 with SMTP id s9mr4394379qai.29.1401319631829;
        Wed, 28 May 2014 16:27:11 -0700 (PDT)
Original-Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [2607:f8b0:400d:c04::230])
        by mx.google.com with ESMTPS id o8si2535896qay.4.2014.05.28.16.27.11
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 28 May 2014 16:27:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c04::230 as permitted sender) client-ip=2607:f8b0:400d:c04::230;
Original-Received: by mail-qg0-f48.google.com with SMTP id i50so19937555qgf.7
        for <std-proposals@isocpp.org>; Wed, 28 May 2014 16:27:11 -0700 (PDT)
X-Received: by 10.140.96.51 with SMTP id j48mr4436797qge.24.1401319631682;
 Wed, 28 May 2014 16:27:11 -0700 (PDT)
Original-Received: by 10.224.181.5 with HTTP; Wed, 28 May 2014 16:27:11 -0700 (PDT)
In-Reply-To: <CANh-dXkeX2SSJ7ZEdnOOm2ZnN-WcgbxYBmODiLtp0T4vpzF1rg@mail.gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c04::230 as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:10942
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10942>

On 29 May 2014 00:15, 'Jeffrey Yasskin' via ISO C++ Standard - Future
Proposals <std-proposals@isocpp.org> wrote:
> On Wed, May 28, 2014 at 1:38 PM, Diggory Blake <diggsey@googlemail.com> wrote:
>> Also, access modifiers are not there for security reasons - it's trivial to
>> bypass them if one really wanted to - they're there to prevent accidental
>> misuse, or in other words, human error, although they also serve as a useful
>> form of documentation.
>
> Yep. And the fact that Java and C# -- languages which _could_ use
> access control for security purposes -- choose to allow reflection to
> override that control, is an argument that C++ shouldn't try either. I
> also haven't heard big complaints from Java users that this use of
> reflection causes problems.

Ah. My understanding of java reflection seems outdated, I didn't know
that it's possible to use setAccessible.

I'm not thinking of security. I'm thinking of what a class designer is trying
to express, and what the repercussions of allowing violations of that
are.

I still think it would be worthwhile to carefully consider what we
want to enable,
and certainly what we want to enable by-default/conveniently. Providing a
too-convenient way to bypass access controls via a reflection mechanism
will sure as hell mean such tricks will spread like a wildfire. I'm not going
to debug the end result, and neither is any of you, regardless of how
convenient it may seem to be at first glance.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
