220 25309 <C98AB9FE-13A6-433D-BCDC-B67C6DD9787D@gmx.de> article
Path: news.gmane.org!not-for-mail
From: Daniel Frey <d.frey@gmx.de>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: [RFC] Call for considering "the big picture"
 re: tuples and parameter packs
Date: Mon, 21 Mar 2016 18:36:07 +0100
Lines: 80
Approved: news@gmane.org
Message-ID: <C98AB9FE-13A6-433D-BCDC-B67C6DD9787D@gmx.de>
References: <nch85i$8ob$1@ger.gmane.org> <1FCE896E-001A-4F56-8866-FB201ABF3391@gmx.de> <nck8gb$9kp$1@ger.gmane.org> <6605C1A6-7DB7-4CDF-9B36-BEE95D90CAED@gmx.de> <ncmni2$ir6$1@ger.gmane.org> <56EF33D4.5070509@wanadoo.fr> <20160321032111.4898897.41547.8488@gmail.com> <ncp8uh$8ou$1@ger.gmane.org> <5544dac2-1449-4039-89b9-e72e98a3db36@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\))
Content-Type: multipart/signed; boundary="Apple-Mail=_592E0FE3-D687-4625-ADCD-F45271F78D17"; protocol="application/pgp-signature"; micalg=pgp-sha1
X-Trace: ger.gmane.org 1458581779 19640 80.91.229.3 (21 Mar 2016 17:36:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 21 Mar 2016 17:36:19 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDYYLHN44AERBCPCYC3QKGQEUI5Q7TA@isocpp.org Mon Mar 21 18:36:10 2016
Return-path: <std-proposals+bncBDYYLHN44AERBCPCYC3QKGQEUI5Q7TA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f198.google.com ([209.85.217.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDYYLHN44AERBCPCYC3QKGQEUI5Q7TA@isocpp.org>)
	id 1ai3kQ-0005Of-Eb
	for gclcip-std-proposals@m.gmane.org; Mon, 21 Mar 2016 18:36:10 +0100
Original-Received: by mail-lb0-f198.google.com with SMTP id wn5sf62697475lbb.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 21 Mar 2016 10:36:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:subject:from:in-reply-to:date:message-id:references:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=/39k1n1rlBqBGISUIBSVq9IGnFLyCYrLA1vB79CS/WA=;
        b=aKTHTNC0xvR/QDPcEQ5AUibC5o264SUatkXA9fYxNSpBjR+TraezOS1f+kqiJ7SWd3
         i6FEGYDwSnhvbql2Y0ZDrgm3ZRT9sDSQwn1ZEEWJ3XN7nMJAws/ciUx3gsNT16Bvq3oT
         ikQjwg8lE9aFhXOo0uNOVQIiB8hivq5ZJLis5YKpu6TlUr1dUCjJJhoicuRT0LfYvo+G
         xX1/u+xBBRu82rLEjzCHXUl9lge1lv3w0K4lz55nLwazAbLzGMqrvHg1mge0/3DtT2B8
         vy9w5uFePGc+VWLveKy/ZIHGb4Na5E3gZXAZenIBCTDdhh83xJxlQPT7xgIqw6aM2CN5
         GEow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:subject:from:in-reply-to:date
         :message-id:references:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=/39k1n1rlBqBGISUIBSVq9IGnFLyCYrLA1vB79CS/WA=;
        b=h0o4nY4fmiZo5w2/Qpy5yBoD+Bpj2Kl4INDvlVtD7UKO/Hchlge9eC7FRe1fvROCna
         LIknP4OjjiBJp6m3ohBT8uDJhqvKYPJm27gDBqgZALHJpzu1bajlKkIb457C1OssAIz3
         I+qN9wAx5ut1apgzXkkjf2FLebtjGZRG5vJE7rE9wQs48aIUEWsjYYNiye3Z97KqqpUq
         8vgT+zC5DlrdH708SIjL5TrB2trbP+KzWrsJNWpS2S9qlQ4+PgnTQ3KwX8QASeCn1KZP
         CfabV7idbharrAjTXK19Uygh4PdYuVIzcbjsOYC58lX8R4dm01lO5zEXyIi6M+3RUAUO
         cnvQ==
X-Gm-Message-State: AD7BkJKcESIY0q3FoyDE4HMYZVyNvQXX0/T1O1a7SckxNb5Hf4QVGGqlJ2Z//A6bmv0t+g==
X-Received: by 10.112.40.200 with SMTP id z8mr3929747lbk.16.1458581769941;
        Mon, 21 Mar 2016 10:36:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.46.14 with SMTP id u14ls700742wmu.22.canary; Mon, 21 Mar
 2016 10:36:08 -0700 (PDT)
X-Received: by 10.28.5.203 with SMTP id 194mr15957514wmf.101.1458581768817;
        Mon, 21 Mar 2016 10:36:08 -0700 (PDT)
Original-Received: from mout.gmx.net (mout.gmx.net. [212.227.17.21])
        by mx.google.com with ESMTPS id s3si14446405wmf.48.2016.03.21.10.36.08
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 21 Mar 2016 10:36:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of d.frey@gmx.de designates 212.227.17.21 as permitted sender) client-ip=212.227.17.21;
Original-Received: from fiasko.fritz.box ([79.204.16.198]) by mail.gmx.com (mrgmx102)
 with ESMTPSA (Nemesis) id 0M7m0a-1Zn3Lk1LMm-00vP00 for
 <std-proposals@isocpp.org>; Mon, 21 Mar 2016 18:36:08 +0100
X-Pgp-Agent: GPGMail 2.6b2
In-Reply-To: <5544dac2-1449-4039-89b9-e72e98a3db36@isocpp.org>
X-Mailer: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sAcI8q0N78e9zxQI8NqCaSzZ+vcV7nwq4PXaH3uC8P/JQ4=
X-Original-Sender: d.frey@gmx.de
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of d.frey@gmx.de designates 212.227.17.21 as permitted sender) smtp.mailfrom=d.frey@gmx.de
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:25309
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25309>

--Apple-Mail=_592E0FE3-D687-4625-ADCD-F45271F78D17
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

> On 21.03.2016, at 18:16, barry.revzin@gmail.com wrote:
>=20
> On Monday, March 21, 2016 at 11:53:52 AM UTC-5, Matthew Woehlke wrote:
>> On 2016-03-20 23:21, Tony V E wrote:
>> > Could the member access syntax actually be s[N] for some struct or cla=
ss s?
>> >
>> > ie just extend operator[] to allow the return type to be different for=
 different constexpr inputs.
>>=20
>> I think that way lies madness... too easy to confuse CTI=C2=B9 with RTI=
=C2=B2.
>> Using a separate syntax makes it clear which is happening, and doesn't
>> run into overload resolution problems for e.g. std::array that needs
>> both. Also...
>>=20
>> (=C2=B9 Compile-Time Indexing)
>> (=C2=B2 Run-Time Indexing, obviously)
>>=20
> Madness? This is C++!

:)

> Anyway, we basically have three categories: tuple (CTI only ever), vector=
 (RTI only ever), and array (both - which do the same thing really, except =
CTI gives some nice safety mechanisms).  We have std::get<I> for CTI, but t=
hat's because it was created as a library to support tuple, right? Is there=
 a conceptual reason why we wouldn't want tuple[0] to work and do something=
 like call tuple.operator[](integral_constant<size_t, 0> ) (or std::get<0>(=
tuple) or something else along these lines)?

I already said earlier that I think s[N] is the right syntax.

The question to me is how to achieve this. Overloading on constexpr paramet=
ers might be one option, templated constructors might be another solution -=
 or just the solution for allowing overloading. IIUC, it was already propos=
ed. If you consider integral_constant to have a ctor that is able to deduce=
 size_t and 0 from the argument (0), you already have everything you need (=
even int and 0 is OK). It also automatically ensures that the argument is a=
 constant.

I fail to see why "confusing" CTI and RTI is a problem. If you misuse overl=
oading or basically any other feature you will get confusing syntax or sema=
ntics. But that doesn't mean that it's bad if used for the right use-cases =
and to me, this is one of the obvious use-cases. Provide access to a tuple'=
s elements via tuple::operator[].

-- Daniel

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/C98AB9FE-13A6-433D-BCDC-B67C6DD9787D%40gmx.de.

--Apple-Mail=_592E0FE3-D687-4625-ADCD-F45271F78D17
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iEYEARECAAYFAlbwMQcACgkQAUxJbew56yFPIgCbBa5DJEGS6ysBEjE3s3yZ9G2a
ze4AoI4/mOXcJLAOGELNV9UKeOnLtT+w
=2/4s
-----END PGP SIGNATURE-----

--Apple-Mail=_592E0FE3-D687-4625-ADCD-F45271F78D17--

.
