220 36669 <9d45f2d0-e2b7-4293-b293-6a558fd59b30@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Cleiton Santoia <cleitonsantoia@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: operator[](...)
Date: Tue, 16 Jan 2018 10:44:44 -0800 (PST)
Lines: 93
Approved: news@gmane.org
Message-ID: <9d45f2d0-e2b7-4293-b293-6a558fd59b30@isocpp.org>
References: <ea8aec36-305c-48ca-aedc-0db120fd8fcc@isocpp.org>
 <8bbeac1f-f698-4e49-9e1f-4cb1ab389b09@isocpp.org> <3b13beef-4a63-1315-c11d-07ba04e6f9bd@gmail.com>
 <4d35c71c-cdc0-45de-976e-2f70b20695c0@isocpp.org> <5a504df3-7632-4035-9f94-7c72f0d094af@isocpp.org>
 <35b73d9f-8920-4282-927e-7c2f06c2b49c@isocpp.org> <CAC+0CCOevw=eZ_pWmneMQ9=cjf3qi3_sD_OUi=jsyE0fdeeR3w@mail.gmail.com>
 <4ab0ef05-5d80-441d-905e-7d25b53f7379@isocpp.org> <CAC+0CCNhTj2iP-LHbKsVyf=gm-iwnCe7j3aMQBwJ1t6tdpu40Q@mail.gmail.com>
 <CALvx3hYJxq72acxWC6vNGvNmCUWNYXw-55PhhozVAmSB_3_7nw@mail.gmail.com>
 <dd321b33-e6e7-4e6f-a29f-baf68578e4e5@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_7864_14740634.1516128284183"
X-Trace: blaine.gmane.org 1516128167 27048 195.159.176.226 (16 Jan 2018 18:42:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 16 Jan 2018 18:42:47 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCBMVWMTUUNBBHMQ7HJAKGQEZ6MCB4A@isocpp.org Tue Jan 16 19:42:43 2018
Return-path: <std-proposals+bncBCBMVWMTUUNBBHMQ7HJAKGQEZ6MCB4A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCBMVWMTUUNBBHMQ7HJAKGQEZ6MCB4A@isocpp.org>)
	id 1ebWC2-0006cQ-N7
	for gclcip-std-proposals@m.gmane.org; Tue, 16 Jan 2018 19:42:42 +0100
Original-Received: by mail-ua0-f198.google.com with SMTP id g30sf11706868uaf.18
        for <gclcip-std-proposals@m.gmane.org>; Tue, 16 Jan 2018 10:44:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=NB4IxdBbkq3VrGuaribIyPCpnZYl9wzViZnnt63YTzk=;
        b=fvIRj9r/2fJBQAxv/cuOstea0wHSCDvrrethdZ4UT9kZXNWbzxdcdpsJVI/vC45zMm
         RKpXIzmB/+7upQS9TdN7sFegWZQ5/plnK9G1FOsSXAgBHYuN05vdqPuxSFhcLcbDv3Q/
         S05klWRfrVGoa11FymMC7I0+6gHarNuK40j35A3CUSxFzOh8AHwJmU0R/pgPkCKI9M6x
         1LyHC8uHC1vRjBDxYOSnHb7vFBQIp8wHP2p7UxCTNnDcIfkOi+IwjWAGMwsizbBuZclt
         vG/6x8/QncQ8u/P3ITmx0xvcm8664rfUclEMM71y+WUntzCTOmHcL9u7PvPuM58L3dBj
         PCOA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=NB4IxdBbkq3VrGuaribIyPCpnZYl9wzViZnnt63YTzk=;
        b=uhDSChwx59iWAwlvbWZnsKojar+4z+UoSlE4mPQv+3dboTwZDLRrbCBLuJ0PpvntZ1
         bbOCPGDxIMi/rVTecb1Ycnfqr1gaTGOehnUM2s0LwXisd/oeN/gkM6rGmVUyMjj1n4I+
         bHAY6moDPXZhZs0dPCgJocLnep3mRvFB/z4xl7vSkjsliAEdP/OVBXF+7IlzVWyu1Vy9
         W8NeCe8E5/PluAM8lN8qyDt5tkoiGt0IFtm0ciHZngcoHRfOa2mRXtlrVcH/RblO6uSZ
         eMslbqUay1F76CI4LF8nIegrpJ2UfNYYtb6RmKp6kgm5WK/5CgVSzrNxat+KoaI6RfFH
         sgTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=NB4IxdBbkq3VrGuaribIyPCpnZYl9wzViZnnt63YTzk=;
        b=tVp8XD0nUaAvS6KzmQEEHNzs8xs7xsINeYnuKLr3HWWMFz1JKvvc4KFyOvFwsLZ6gM
         pRdRfirAh+1IyM7SuDD0k04SiVQw+tQMCOfLQ4aIwvlKT5yvwHzjt2QwM2GLMNbmWRux
         PuIvM2sIJFTuPZ8QMvrnBoVVEPNnn7IJZtRbPfCYYVFG9CCeD7D94D2SMPCUkUZwtNZ7
         enFm2h3HoVhcDYbGkZ6f00/FIvCg6qJ36ofCoL236sFcF2Ua9NBhJY/Coax6LdFjLxCS
         mOri06SbPzhDfdW+RPb7CE5hL6gjWN+HhBPZKj+jQmogI8VaixAmOu/CPdNQ9WiiOlme
         A0HQ==
X-Gm-Message-State: AKwxytfgCCZwp1r4MubKQ/ed6z++zAzlD7NrpTgYyVQkkIn0KpzfwD9u
	sG8kvq804I6haMmH2hRovZoIZQ==
X-Google-Smtp-Source: ACJfBou1yGmLqNCGylYY0fApBU93lvWF8m9eXlSPe/LiUI8dRRG9jJiKL/eO5cHw0+HajtOuYFAqnA==
X-Received: by 10.176.49.84 with SMTP id e20mr79124uam.11.1516128286373;
        Tue, 16 Jan 2018 10:44:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.157.1 with SMTP id g1ls1034307vke.7.gmail; Tue, 16 Jan 2018
 10:44:44 -0800 (PST)
X-Received: by 10.31.147.5 with SMTP id v5mr11581vkd.5.1516128284756;
        Tue, 16 Jan 2018 10:44:44 -0800 (PST)
In-Reply-To: <dd321b33-e6e7-4e6f-a29f-baf68578e4e5@isocpp.org>
X-Original-Sender: cleitonsantoia@gmail.com
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:36669
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36669>

------=_Part_7864_14740634.1516128284183
Content-Type: multipart/alternative; 
	boundary="----=_Part_7865_1390534653.1516128284184"

------=_Part_7865_1390534653.1516128284184
Content-Type: text/plain; charset="UTF-8"


I think that c++ behavior of obj[x,y] is awkward. 

When using this syntax, GCC already warn us:
main.cpp:24:10: warning: left operand of comma operator has no effect 
[-Wunused-value]

Other contexts that [] can appear (lambdas or bindings), the x and y are 
two different things passed to wherever [] will do, only in operator[] it's 
is allowed this "pay two and get one" parameter passing. This is a little 
embarrassing to explain...

Regardless of new uses for operator[]. I'm pro deprecate this.

Said that, easily follows that multi-parameter may use same rules as 
multi-parameter operator().






How about this (admittedly offbeat) syntax:
>
>     x[1; 2; 3]    // use semicolons to separate multidimensional indexes
>

 This is strange, what happens if someone tries x[1,2,3;2;3,2,1] ? mixing 
',' and ';' ?

 

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9d45f2d0-e2b7-4293-b293-6a558fd59b30%40isocpp.org.

------=_Part_7865_1390534653.1516128284184
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><br></div><div>I think that c++ behavior of obj[x,y] =
is awkward.=C2=A0</div><div><br></div><div>When using this syntax, GCC alre=
ady warn us:</div><div><div><span style=3D"background-color: rgb(187, 187, =
170); color: rgb(0, 0, 0); font-family: monospace; font-size: medium; white=
-space: pre;">main.cpp:24:10: warning: left operand of comma operator has n=
o effect [-Wunused-value]</span><br></div></div><div><span style=3D"color: =
rgb(0, 0, 0); font-family: monospace; font-size: medium; white-space: pre; =
background-color: rgb(187, 187, 170);"><br></span></div><div>Other contexts=
 that [] can appear (lambdas or bindings), the x and y are two different th=
ings passed to wherever [] will do, only in operator[] it&#39;s is allowed =
this &quot;pay two and get one&quot; parameter passing. This is a little em=
barrassing to explain...<br></div><div><br></div><div>Regardless of new use=
s for operator[]. I&#39;m pro deprecate this.</div><div><br></div><div>Said=
 that, easily follows that multi-parameter may use same rules as multi-para=
meter operator().</div><div><br></div><div><br></div><div><br></div><div><b=
r></div><div><br></div><div><br></div><div><blockquote class=3D"gmail_quote=
" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding=
-left: 1ex;"><div dir=3D"ltr">How about this (admittedly offbeat) syntax:<d=
iv><br></div><div>=C2=A0 =C2=A0 x[1; 2; 3]=C2=A0 =C2=A0 // use semicolons t=
o separate multidimensional indexes</div></div></blockquote><div><br></div>=
<div>=C2=A0This is strange, what happens if someone tries x[1,2,3;2;3,2,1] =
? mixing &#39;,&#39; and &#39;;&#39; ?</div><div><br></div><div>=C2=A0</div=
></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9d45f2d0-e2b7-4293-b293-6a558fd59b30%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9d45f2d0-e2b7-4293-b293-6a558fd59b30=
%40isocpp.org</a>.<br />

------=_Part_7865_1390534653.1516128284184--

------=_Part_7864_14740634.1516128284183--

.
