220 11470 <b244aedd-5d7b-494b-a192-995059a831d2@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Douglas Boffey <douglas.boffey@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Named function parameters using anonymous structs
 for C and C++
Date: Tue, 17 Jun 2014 06:43:29 -0700 (PDT)
Lines: 135
Approved: news@gmane.org
Message-ID: <b244aedd-5d7b-494b-a192-995059a831d2@isocpp.org>
References: <72c49240-547b-4bf6-8b27-aff6a61c1272@isocpp.org> <cb957c9d-f151-4cdb-b749-c3e158d72e3c@isocpp.org> <ea5e7788-1c8f-43e6-9486-5fec31b22166@isocpp.org> <ce610dc2-be04-4f15-813b-f8aaa55aab63@isocpp.org> <D251F8E8-26EA-46C8-A6FC-877748BB4E46@gmail.com> <36D3B24B-7F24-4ED5-A27C-F4EF71CF244C@gmail.com> <a36b1035-fabd-402f-9817-498acd56e614@isocpp.org>
 <29C6D83B-BD31-42A9-B7BD-2C797E3FE58C@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_63_29705748.1403012609765"
X-Trace: ger.gmane.org 1403012620 28016 80.91.229.3 (17 Jun 2014 13:43:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 17 Jun 2014 13:43:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDSIZVXVVUFBBAUMQGOQKGQEFW4MEMY@isocpp.org Tue Jun 17 15:43:33 2014
Return-path: <std-proposals+bncBDSIZVXVVUFBBAUMQGOQKGQEFW4MEMY@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+bncBDSIZVXVVUFBBAUMQGOQKGQEFW4MEMY@isocpp.org>)
	id 1Wwtfg-00033l-Q2
	for gclcip-std-proposals@m.gmane.org; Tue, 17 Jun 2014 15:43:33 +0200
Original-Received: by mail-yh0-f72.google.com with SMTP id f10sf32190069yha.11
        for <gclcip-std-proposals@m.gmane.org>; Tue, 17 Jun 2014 06:43:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        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
         :content-type;
        bh=tKBPpTUPKXaWIvox+nJTYnpGnXOWSBj0YeSMBC8kd1k=;
        b=wGljEjWcnvdgBZy/N1X6FbbgXH5vdKAQ+OfdYXi2ahlnWbnYAVhEk8d/VWQkkDXf0i
         5hOtfpuRvx2L9x8n0efRLjKm2ls2eiasrZ20g7FK5fMH6KP2UQrUl0B8xMkhPGEj4Ic6
         J2BvfNREtTDhLWxvqepS2b20KP7fpcqmDIbfy8ec01JOvwiOUXPMQJorFnMYCPnVnY65
         aPcZDcCcO0h3hKs2GouVD6xumBH+mSrx9Voj5JqFj8C3GQ7V4W9Ax86ML5/q3BdWsk4J
         B6aYBWxVN1epIYMeJll9CJcv9wws/yCmXNHZ9nPxHCkUvxctUamBaiLVY3LlRiKk29a+
         AudA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=tKBPpTUPKXaWIvox+nJTYnpGnXOWSBj0YeSMBC8kd1k=;
        b=XDe7d7SEj41MYpPRTYOjv68aKDv+R9PaMyYQh918UGXzRjY8pp/XRACXgAtTr4umMW
         f+SQlASR1/bJ5y1j8nWQ/oa322L+s85edfmUQ9HiUHQSxZXqHjXVpBkmGeJ2BhfGYXqS
         LQcDhxzWYwQ9r3vfM5XqlvK+d7aNLV1Uql7KhLLRal2J3PGcpAVn41BvPvVtku5qdoAK
         ZCuQsktGCq1EDcYBDgVd5lBCU6+tnm5NTzOkQ7KnEpyEHrbCyFEVMA5PF7p/E8rtgNry
         wBId748vCKIbd7vNK9Vj5TeyEAsi2c02neHyFYpcar9q9u6/xuWx7jBKrKfM2guSrdht
         SJiA==
X-Gm-Message-State: ALoCoQkSgtNPhR+yFqsAiAv3vRwQ4PTImCS3c90s86MgGBH+NzYQFoY1eckY7Ht19Eiyd1RXxFTe
X-Received: by 10.58.34.47 with SMTP id w15mr1083003vei.20.1403012611593;
        Tue, 17 Jun 2014 06:43:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.81.38 with SMTP id w6ls1930410obx.17.gmail; Tue, 17 Jun
 2014 06:43:30 -0700 (PDT)
X-Received: by 10.182.220.232 with SMTP id pz8mr78201obc.13.1403012610546;
        Tue, 17 Jun 2014 06:43:30 -0700 (PDT)
In-Reply-To: <29C6D83B-BD31-42A9-B7BD-2C797E3FE58C@gmail.com>
X-Original-Sender: douglas.boffey@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:11470
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11470>

------=_Part_63_29705748.1403012609765
Content-Type: text/plain; charset=UTF-8


On Tuesday, 17 June 2014 05:43:28 UTC+1, David Krauss wrote:
 
<snip>
 

>  struct point {
>     int top, left;
> };
>
> struct rect {
>     point top_left, bottom_right;
>     float angle;
>
>     rect( /* struct */ { int top, left, bottom, right; }, float in_angle = 
> 0 )
>         : top( top ), left( left ), bottom( bottom ), right( right ), 
> angle( in_angle ) {}
>
>     rect( /* struct */ { int top, left, height, width; }, float in_angle = 
> 0 )
>         : top( in_top ), left( in_left )
>         , bottom( in_top + in_width ), right( in_left + in_width )
>         , angle( in_angle ) {}
>
>     rect( /* struct */ { point top_left, point bottom_right; }, float 
> in_angle = 0 )
>         : top_left( top_left ), bottom_right( bottom_right ), angle( 
> in_angle ) {}
> };
>
> rect a( .top = 4, .height = 43, .left = 10, .width = 100 ); // OK
> rect b( .top_left = { 4, 43 }, .bottom_right = { 10, 100 } ); // OK
> rect c( .top_left = 4, 43, .bottom_right = 10, 100 ); // OK: (additional) 
> brace elision
>
Please, no.  That could only cause confusion, as the number of actual 
parameters (2) is not the number of apparent parameters (4).
 

>  rect d( .top = 4, 43, .bottom = 10, 100 ); // OK: initialize successive 
> members.
> rect e( .top = 4, 43, 10, 100 ); // Error: ambiguous.
> rect f( 4, 43, .bottom = 10, 100 ); // OK, if poor style, the user is 
> asking for it.
> rect g( .top = 4, .bottom = 47, .left = 10, .right = 110, 35_degrees ); // 
> Error: mixed named and unnamed
> rect h( { .top = 4, .bottom = 47, .left = 10, .right = 110 }, 35_degrees 
> ); // OK
>
>
>

-- 

--- 
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/.

------=_Part_63_29705748.1403012609765
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><DIV><BR>On Tuesday, 17 June 2014 05:43:28 UTC+1, David Kr=
auss wrote:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;snip&gt;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3Dgmail_quote>
<DIV style=3D"WORD-WRAP: break-word">
<DIV>
<DIV><FONT face=3DCourier>struct point {</FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; int top, left;</FONT></DIV>
<DIV><FONT face=3DCourier>};</FONT></DIV>
<DIV><FONT face=3DCourier><BR></FONT></DIV>
<DIV><FONT face=3DCourier>struct rect {<BR>&nbsp; &nbsp; point top_left, bo=
ttom_right;</FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; float angle;<BR><BR>&nbsp; &nbsp; r=
ect( /* struct */ { int top, left, bottom, right; }, float in_angle =3D 0 )=
<BR>&nbsp; &nbsp; &nbsp; &nbsp; : top( top ), left( left ), bottom( bottom =
), right( right ), angle( in_angle ) {}<BR><BR></FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; rect( /* struct */ { int top, left,=
 height, width; }, float in_angle =3D 0 )<BR>&nbsp; &nbsp; &nbsp; &nbsp; : =
top( in_top ), left( in_left )<BR>&nbsp; &nbsp; &nbsp; &nbsp; , bottom( in_=
top + in_width ), right( in_left + in_width )</FONT></DIV>
<DIV><FONT face=3DCourier>&nbsp; &nbsp; &nbsp; &nbsp; , angle( in_angle ) {=
}<BR><BR>&nbsp; &nbsp; rect( /* struct */ { point top_left, point bottom_ri=
ght; }, float in_angle =3D 0 )<BR>&nbsp; &nbsp; &nbsp; &nbsp; : top_left( t=
op_left ), bottom_right( bottom_right ),&nbsp;angle( in_angle&nbsp;) {}<BR>=
};<BR><BR>rect a( .top =3D 4, .height =3D 43, .left =3D 10, .width =3D 100 =
); // OK<BR>rect b( .top_left =3D { 4, 43 }, .bottom_right =3D { 10, 100 } =
); // OK<BR>rect c( .top_left =3D 4, 43, .bottom_right =3D 10, 100 ); // OK=
: (additional) brace elision<BR></FONT></DIV></DIV></DIV></BLOCKQUOTE>
<DIV>Please, no.&nbsp; That could only cause confusion, as the number of ac=
tual parameters (2) is not the number of apparent parameters (4).</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3Dgmail_quote>
<DIV style=3D"WORD-WRAP: break-word">
<DIV>
<DIV><SPAN style=3D"FONT-FAMILY: Courier">rect d( .top =3D 4, 43, .bottom =
=3D 10, 100 ); // OK: initialize successive members.</SPAN><BR style=3D"FON=
T-FAMILY: Courier"><FONT face=3DCourier>rect e( .top =3D 4, 43, 10, 100 ); =
// Error: ambiguous.<BR></FONT><SPAN style=3D"FONT-FAMILY: Courier">rect f(=
 4, 43, .bottom =3D 10, 100 ); // OK, if poor style, the user is asking for=
 it.</SPAN><BR style=3D"FONT-FAMILY: Courier"><FONT face=3DCourier>rect g( =
..top =3D 4, .bottom =3D 47, .left =3D 10, .right =3D 110, 35_degrees ); // =
Error: mixed named and unnamed<BR>rect h( { .top =3D 4, .bottom =3D 47, .le=
ft =3D 10, .right =3D 110 }, 35_degrees ); // OK<BR></FONT><BR></DIV></DIV>
<DIV><BR></DIV></DIV></BLOCKQUOTE></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_63_29705748.1403012609765--

.
