220 8710 <0948fc8a-2191-4ab0-97df-cf354a470828@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Andrew Tomazos <andrewtomazos@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "Raw" preprocessor macro arguments
Date: Sun, 19 Jan 2014 14:15:46 -0800 (PST)
Lines: 379
Approved: news@gmane.org
Message-ID: <0948fc8a-2191-4ab0-97df-cf354a470828@isocpp.org>
References: <c0398870-b265-4d02-a814-ad84a472520c@isocpp.org>
 <47db64d6-64fb-4243-bded-e36fc8be30b2@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_552_24779971.1390169746827"
X-Trace: ger.gmane.org 1390169743 8317 80.91.229.3 (19 Jan 2014 22:15:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 19 Jan 2014 22:15:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD5KHQXXWYPRBE456GLAKGQE322FGBA@isocpp.org Sun Jan 19 23:15:51 2014
Return-path: <std-proposals+bncBD5KHQXXWYPRBE456GLAKGQE322FGBA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f70.google.com ([209.85.220.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD5KHQXXWYPRBE456GLAKGQE322FGBA@isocpp.org>)
	id 1W50ej-0005QM-4W
	for gclcip-std-proposals@m.gmane.org; Sun, 19 Jan 2014 23:15:49 +0100
Original-Received: by mail-pa0-f70.google.com with SMTP id kq14sf15987760pab.9
        for <gclcip-std-proposals@m.gmane.org>; Sun, 19 Jan 2014 14:15:48 -0800 (PST)
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=MZi1hq2Ih9Hru/iJeYO/9cuSwpxKZd+Npdd1XtE8iH4=;
        b=cCKGukbbSPOA/q21Gr4IgBXyTqOJSdxf1culewjqWiFyKmqo5Duf1EsBDqfswRU8Cc
         im+IQbIh+MgeR/5LI/uVgklc9Lei84cVpB21xXJJcRVvvLlzGr7DYbwbPIKI/yLgAK83
         pckYVQmzm5pLXDZhN6cDV1NAooz7HksLjKLkaHEIBvX/YqxJBDGgaSMflcsp5wgHfw3f
         j2hLLBdMsStqzZIqm5Y45WHFYmYhY31X0LhZ1HeGLSaiVvGnM1PXRAd0hq58yeGC1khZ
         ui2gXT677sNBtV2J2KgsP5i4QGruq8wwMPraMDW1wWZ06k6U4j0l6n0HRi8GMxPSGw3E
         N6Mg==
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=MZi1hq2Ih9Hru/iJeYO/9cuSwpxKZd+Npdd1XtE8iH4=;
        b=gbNMrfSDykch6ui451MU6FPuU0vtNuP7lJVaivNr4iETB45FHufIQ+FzSQMC1UQbbo
         u2IPW7NtWnSfVnIwHctQDei58Msn12zOgpezcwg+qE+asfTmMUOJUsgiKzkNepM1MaqD
         VyCvCk3C3ZJO/F3FLQLsyVczhj3FTmko+pCv5VPh9uTNlTlwFFH3Kkw8sjqzu7a2vR2t
         dLu2B2TmAJ0rF774eAO1iVpkRmXHoRT8eB9MwaZaln29N+APzpzv3WE3sNMQ1Thex8YO
         H6xwXWP+16FCdnnpFy+9eOjF7mH8GQ3MUH2cEavXV8f9HL90S3ag9PPPRWufx9nqeNDN
         vP8g==
X-Gm-Message-State: ALoCoQkDNiLCXR+x1F0ehzG3bLY/14r+A5vaxw1uAeTZXKfkG4VDX+WsOLH97chXjjVgkrZZBlCs
X-Received: by 10.68.133.164 with SMTP id pd4mr5451478pbb.1.1390169747978;
        Sun, 19 Jan 2014 14:15:47 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.96.52 with SMTP id j49ls874434qge.7.gmail; Sun, 19 Jan
 2014 14:15:47 -0800 (PST)
X-Received: by 10.140.48.8 with SMTP id n8mr655qga.36.1390169747357;
        Sun, 19 Jan 2014 14:15:47 -0800 (PST)
In-Reply-To: <47db64d6-64fb-4243-bded-e36fc8be30b2@isocpp.org>
X-Original-Sender: andrewtomazos@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:8710
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8710>

------=_Part_552_24779971.1390169746827
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Actually sorry, I am slightly wrong about that solution.  The argument to=
=20
RAW will be parsed in turn as two arguments and not one.  It should be:

    #define RAW(...) __VA_ARGS__

This will work I think.

On Sunday, January 19, 2014 10:11:35 PM UTC+1, Andrew Tomazos wrote:
>
> #define RAW(x) x
>
> GENERATE_FUNC(RAW(std::pair<int, int>), getPair1), return std::make_pair(=
1
> , 1));
>
> The arguments to a macro are identified before macro expansion takes plac=
e=20
> on the arguments.  So the above will nest out the comma like you want.
>
> The preprocessor respects parenthesis for nesting arguments.
>
> From 16.2:
>
> The sequence of preprocessing tokens bounded by the outside-most matching=
=20
> parentheses forms the list of
> arguments for the function-like macro. The individual arguments within th=
e=20
> list are separated by comma
> preprocessing tokens, *but comma preprocessing tokens between matching=20
> inner parentheses do not separate*
> *arguments*.
>
> *After the arguments for the invocation of a function-like macro have bee=
n=20
> identi=EF=AC=81ed, argument substitution*
> *takes place.* A parameter in the replacement list, unless preceded by a=
=20
> # or ## preprocessing token or
> followed by a ## preprocessing token (see below), is replaced by the=20
> corresponding argument after all macros
> contained therein have been expanded. Before being substituted, each=20
> argument=E2=80=99s preprocessing tokens are
> completely macro replaced as if they formed the rest of the preprocessing=
=20
> =EF=AC=81le; no other preprocessing tokens
> are available.
>
> On Sunday, January 19, 2014 6:28:43 PM UTC+1, Vittorio Romeo wrote:
>>
>> *Preprocessor macros*, even if potentially *unsafe*, still have place in=
=20
>> a lot of C/C++ programs. Using macros is the sometimes only way to avoid=
=20
>> verbose code repetition, to simulate static reflection or to generate co=
de=20
>> that would be impossible to generate only using templates.
>> An issue with macros is that passing arguments is sometimes really=20
>> counter-intuitive and dangerous.=20
>>
>> Example:
>> #define GENERATE_FUNC(mType, mName, mBody) mType mName(){ mBody }
>>
>>
>> // Ok, generates valid code
>> GENERATE_FUNC(void, printHi, printf("hi");)
>>
>>
>> // Ok, generates valid code
>> GENERATE_FUNC(void, printNumber, printf("%d", 5);)
>>
>>
>> // The comma in "<int, int>" is read as an additional argument - macro=
=20
>> expansion fails
>> GENERATE_FUNC(std::pair<int, int>, getPair1, return std::make_pair(1, 1
>> );)
>>
>>
>> // The comma in "<int, int>" is read correctly, but the generated code i=
s=20
>> invalid, as=20
>> // the round parenthesis persist in the return type (look below for the=
=20
>> expansion)
>> GENERATE_FUNC((std::pair<int, int>), getPair2, return std::make_pair(1, =
1
>> );)
>> /*
>>     (std::pair<int, int>) getPair2() { return std::make_pair(1, 1); }
>> */
>>
>> There are possible solutions to this issue:
>> 1. Create a typedef for `std::pair<int, int>` - this solution is specifi=
c=20
>> to this case, and may not always be applicable. Additionally, it require=
s=20
>> the coder to define a new typedef,
>> 2. Create multiple macros (for example, GENERATE_FUNC_START and=20
>> GENERATE_FUNC_END), and let the user write the code in-between - this=20
>> solution is ugly and error prone. Also, it scales poorly, as k "body"=20
>> arguments would require k+1 macro definitions.
>>
>> These solutions, however, can be defined *hacks. *The issue is that=20
>> there is no way to pass a "raw" argument to the preprocessor.=20
>>
>> Here's what I propose:
>> *Similarly to C++11 raw strings, have a new syntax that allows the user=
=20
>> to pass "raw arguments" to preprocessor macros.*
>>
>> Example:
>> GENERATE_FUNC(__R(std::pair<int, int>), __R(getPairRaw), __R(return std:=
:
>> make_pair(1, 1))
>>
>> Specification:
>> < __R > <prefix> <(> <...> <)> <suffix>=20
>>
>> Prefix/suffix example:
>> GENERATE_FUNC(__R***(ReturnType(int*))***, __R(getIntPtr), __R(return &
>> someInt;))
>>
>> Unit test before example:
>> UNIT_TEST_START()
>>      EXPECT(some predicate);
>>      ...=20
>> UNIT_TEST_END()
>>
>> Unit test after example:
>> UNIT_TEST(__R(
>>      EXPECT(some predicate);
>>      ...=20
>> ))
>>
>> This "raw syntax" would also fix the "comma problem", that forced users=
=20
>> to define a "COMMA" macro for years:
>> __R(,)
>>
>> *What do you think?*
>>
>

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_552_24779971.1390169746827
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Actually sorry, I am slightly wrong about that solution. &=
nbsp;The argument to RAW will be parsed in turn as two arguments and not on=
e. &nbsp;It should be:<div><br></div><div>&nbsp; &nbsp; #define RAW(...) __=
VA_ARGS__<br><br>This will work I think.</div><div><br></div><div>On Sunday=
, January 19, 2014 10:11:35 PM UTC+1, Andrew Tomazos wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr">#define RAW(x) x<div><br></di=
v><div><span style=3D"font-family:monospace;background-color:rgb(250,250,25=
0);color:rgb(0,0,0)">GENERATE_FUNC</span><span style=3D"font-family:monospa=
ce;background-color:rgb(250,250,250);color:rgb(102,102,0)">(RAW(</span><spa=
n style=3D"font-family:monospace;background-color:rgb(250,250,250);color:rg=
b(0,0,0)">std</span><span style=3D"font-family:monospace;background-color:r=
gb(250,250,250);color:rgb(102,102,0)">::</span><span style=3D"font-family:m=
onospace;background-color:rgb(250,250,250);color:rgb(0,0,0)">pair</span><sp=
an style=3D"font-family:monospace;background-color:rgb(250,250,250);color:r=
gb(102,102,0)">&lt;</span><span style=3D"font-family:monospace;background-c=
olor:rgb(250,250,250);color:rgb(0,0,136)">in<wbr>t</span><span style=3D"fon=
t-family:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">=
,</span><span style=3D"font-family:monospace;background-color:rgb(250,250,2=
50);color:rgb(0,0,0)">&nbsp;</span><span style=3D"font-family:monospace;bac=
kground-color:rgb(250,250,250);color:rgb(0,0,136)">int</span><span style=3D=
"font-family:monospace;background-color:rgb(250,250,250);color:rgb(102,102,=
0)">&gt;),</span><span style=3D"font-family:monospace;background-color:rgb(=
250,250,250);color:rgb(0,0,0)">&nbsp;getPair1)</span><span style=3D"font-fa=
mily:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">,</s=
pan><span style=3D"font-family:monospace;background-color:rgb(250,250,250);=
color:rgb(0,0,0)">&nbsp;</span><span style=3D"font-family:monospace;backgro=
und-color:rgb(250,250,250);color:rgb(0,0,136)">return</span><span style=3D"=
font-family:monospace;background-color:rgb(250,250,250);color:rgb(0,0,0)">&=
nbsp;<wbr>std</span><span style=3D"font-family:monospace;background-color:r=
gb(250,250,250);color:rgb(102,102,0)">::</span><span style=3D"font-family:m=
onospace;background-color:rgb(250,250,250);color:rgb(0,0,0)">make_pair</spa=
n><span style=3D"font-family:monospace;background-color:rgb(250,250,250);co=
lor:rgb(102,102,0)">(</span><span style=3D"font-family:monospace;background=
-color:rgb(250,250,250);color:rgb(0,102,102)">1</span><span style=3D"font-f=
amily:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">,</=
span><span style=3D"font-family:monospace;background-color:rgb(250,250,250)=
;color:rgb(0,0,0)">&nbsp;</span><span style=3D"font-family:monospace;backgr=
ound-color:rgb(250,250,250);color:rgb(0,102,102)">1</span><span style=3D"fo=
nt-family:monospace;background-color:rgb(250,250,250)"><font color=3D"#6666=
00">));</font></span><br></div><div><br></div><div>The arguments to a macro=
 are identified before macro expansion takes place on the arguments. &nbsp;=
So the above will nest out the comma like you want.</div><div><br></div><di=
v>The preprocessor respects parenthesis for nesting arguments.</div><div><b=
r></div><div>From 16.2:</div><div><br><div>The sequence of preprocessing to=
kens bounded by the outside-most matching parentheses forms the list of</di=
v><div>arguments for the function-like macro. The individual arguments with=
in the list are separated by comma</div><div>preprocessing tokens, <b>but c=
omma preprocessing tokens between matching inner parentheses do not separat=
e</b></div><div><b>arguments</b>.</div><div><br></div><div><div><b>After th=
e arguments for the invocation of a function-like macro have been identi=EF=
=AC=81ed, argument substitution</b></div><div><b>takes place.</b> A paramet=
er in the replacement list, unless preceded by a # or ## preprocessing toke=
n or</div><div>followed by a ## preprocessing token (see below), is replace=
d by the corresponding argument after all macros</div><div>contained therei=
n have been expanded. Before being substituted, each argument=E2=80=99s pre=
processing tokens are</div><div>completely macro replaced as if they formed=
 the rest of the preprocessing =EF=AC=81le; no other preprocessing tokens</=
div><div>are available.</div></div><div><br></div>On Sunday, January 19, 20=
14 6:28:43 PM UTC+1, Vittorio Romeo wrote:<blockquote class=3D"gmail_quote"=
 style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr"><b>Preprocessor macros</b>,&nbsp;even if potentiall=
y&nbsp;<i>unsafe</i>, still have place in a lot of C/C++ programs. Using ma=
cros is the sometimes only way to avoid verbose code repetition, to simulat=
e static reflection or to generate code that would be impossible to generat=
e only using templates.<div>An issue with macros is that passing arguments =
is sometimes really counter-intuitive and dangerous.&nbsp;<br><br>Example:<=
/div><div><div style=3D"background-color:rgb(250,250,250);border:1px solid =
rgb(187,187,187);word-wrap:break-word"><code><div><span style=3D"color:#800=
">#define</span><span style=3D"color:#000"> GENERATE_FUNC</span><span style=
=3D"color:#660">(</span><span style=3D"color:#000">mType</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> mName</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> mBody</span><span style=
=3D"color:#660">)</span><span style=3D"color:#000"> mType mName</span><span=
 style=3D"color:#660">(){</span><span style=3D"color:#000"> mBody </span><s=
pan style=3D"color:#660">}</span><span style=3D"color:#000"><br><br><br></s=
pan><span style=3D"color:#800">// Ok, generates valid code</span><span styl=
e=3D"color:#000"><br>GENERATE_FUNC</span><span style=3D"color:#660">(</span=
><span style=3D"color:#008">void</span><span style=3D"color:#660">,</span><=
span style=3D"color:#000"> printHi</span><span style=3D"color:#660">,</span=
><span style=3D"color:#000"> printf</span><span style=3D"color:#660">(</spa=
n><span style=3D"color:#080">"hi"</span><span style=3D"color:#660">);)</spa=
n><span style=3D"color:#000"><br><br><br></span><span style=3D"color:#800">=
// Ok, generates valid code</span><span style=3D"color:#000"><br>GENERATE_F=
UNC</span><span style=3D"color:#660">(</span><span style=3D"color:#008">voi=
d</span><span style=3D"color:#660">,</span><span style=3D"color:#000"> prin=
tNumber</span><span style=3D"color:#660">,</span><span style=3D"color:#000"=
> printf</span><span style=3D"color:#660">(</span><span style=3D"color:#080=
">"%d"</span><span style=3D"color:#660">,</span><span style=3D"color:#000">=
 </span><span style=3D"color:#066">5</span><span style=3D"color:#660">);)</=
span><span style=3D"color:#000"><br><br><br></span><span style=3D"color:#80=
0">// The comma in "&lt;int, int&gt;" is read as an additional argument - m=
acro expansion fails</span><span style=3D"color:#000"><br>GENERATE_FUNC</sp=
an><span style=3D"color:#660">(</span><span style=3D"color:#000">std</span>=
<span style=3D"color:#660">::</span><span style=3D"color:#000">pair</span><=
span style=3D"color:#660">&lt;</span><span style=3D"color:#008">int</span><=
span style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span =
style=3D"color:#008">int</span><span style=3D"color:#660">&gt;,</span><span=
 style=3D"color:#000"> getPair1</span><span style=3D"color:#660">,</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#008">return</span><s=
pan style=3D"color:#000"> std</span><span style=3D"color:#660">::</span><sp=
an style=3D"color:#000">make_pair</span><span style=3D"color:#660">(</span>=
<span style=3D"color:#066">1</span><span style=3D"color:#660">,</span><span=
 style=3D"color:#000"> </span><span style=3D"color:#066">1</span><span styl=
e=3D"color:#660">);)</span><span style=3D"color:#000"><br><br><br></span><s=
pan style=3D"color:#800">// The comma in "&lt;int, int&gt;" is read correct=
ly, but the generated code is invalid, as </span><span style=3D"color:#000"=
><br></span><span style=3D"color:#800">// the round parenthesis persist in =
the return type (look below for the expansion)</span><span style=3D"color:#=
000"><br>GENERATE_FUNC</span><span style=3D"color:#660">((</span><span styl=
e=3D"color:#000">std</span><span style=3D"color:#660">::</span><span style=
=3D"color:#000">pair</span><span style=3D"color:#660">&lt;</span><span styl=
e=3D"color:#008">int</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">int</span><span style=3D=
"color:#660">&gt;),</span><span style=3D"color:#000"> getPair2</span><span =
style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">return</span><span style=3D"color:#000"> std</span><span st=
yle=3D"color:#660">::</span><span style=3D"color:#000">make_pair</span><spa=
n style=3D"color:#660">(</span><span style=3D"color:#066">1</span><span sty=
le=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D=
"color:#066">1</span><span style=3D"color:#660">);)</span><span style=3D"co=
lor:#000"><br></span><span style=3D"color:#800">/*<br>&nbsp; &nbsp; (std::p=
air&lt;int, int&gt;) getPair2() { return std::make_pair(1, 1); }<br>*/</spa=
n></div></code></div><div><br></div></div><div>There are possible solutions=
 to this issue:</div>1. Create a typedef for `std::pair&lt;int, int&gt;` - =
this solution is specific to this case, and may not always be applicable. A=
dditionally, it requires the coder to define a new typedef,<div>2. Create m=
ultiple macros (for example, GENERATE_FUNC_START and GENERATE_FUNC_END), an=
d let the user write the code in-between - this solution is ugly and error =
prone. Also, it scales poorly, as k "body" arguments would require k+1 macr=
o definitions.</div><div><br></div><div>These solutions, however, can be de=
fined <i>hacks. </i>The issue is that there is no way to pass a "raw" argum=
ent to the preprocessor.&nbsp;</div><div><br></div><div>Here's what I propo=
se:</div><div><b>Similarly to C++11 raw strings, have a new syntax that all=
ows the user to pass "raw arguments" to preprocessor macros.</b></div><div>=
<br></div><div>Example:</div><div><div style=3D"background-color:rgb(250,25=
0,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code><div><=
font color=3D"#000000"><span style=3D"color:#000">GENERATE_FUNC</span><span=
 style=3D"color:#660">(</span><span style=3D"color:#000">__R</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#000">std</span><span style=
=3D"color:#660">::</span><span style=3D"color:#000">pair</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#008">in<wbr>t</span><span =
style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">int</span><span style=3D"color:#660">&gt;),</span><span sty=
le=3D"color:#000"> __R</span><span style=3D"color:#660">(</span><span style=
=3D"color:#000">getPairRaw</span><span style=3D"color:#660">),</span><span =
style=3D"color:#000"> __R</span><span style=3D"color:#660">(</span><span st=
yle=3D"color:#008">return</span><span style=3D"color:#000"> std</span><span=
 style=3D"color:#660">::</span><span style=3D"color:#000">make_pair</span><=
span style=3D"color:#660">(</span><span style=3D"color:#066">1</span><span =
style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=
=3D"color:#066">1</span><span style=3D"color:#660">))</span><span style=3D"=
color:#000"><br></span></font></div></code></div><br>Specification:</div><d=
iv><div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187=
,187,187);word-wrap:break-word"><code><div><font color=3D"#660066"><span st=
yle=3D"color:#000">&lt; __R &gt; </span><span style=3D"color:#008">&lt;pref=
ix&gt;</span><span style=3D"color:#000"> &lt;(&gt; &lt;...&gt; &lt;)&gt; </=
span><span style=3D"color:#008">&lt;suffix&gt;</span><span style=3D"color:#=
000"> </span></font></div></code></div><br>Prefix/suffix example:</div><div=
><div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,1=
87,187);word-wrap:break-word"><code><div><span style=3D"color:#000">GENERAT=
E_FUNC</span><span style=3D"color:#660">(</span><span style=3D"color:#000">=
__R</span><span style=3D"color:#660">***(</span><span style=3D"color:#606">=
ReturnTyp<wbr>e</span><span style=3D"color:#660">(</span><span style=3D"col=
or:#008">int</span><span style=3D"color:#660">*))***,</span><span style=3D"=
color:#000"> __R</span><span style=3D"color:#660">(</span><span style=3D"co=
lor:#000">getIntPtr</span><span style=3D"color:#660">),</span><span style=
=3D"color:#000"> __R</span><span style=3D"color:#660">(</span><span style=
=3D"color:#008">return</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">&amp;</span><font color=3D"#006666"><span style=3D"color:#0=
00">someInt</span><span style=3D"color:#660">;))</span><span style=3D"color=
:#000"><br></span></font></div></code></div><br></div><div>Unit test before=
 example:</div><div><div style=3D"background-color:rgb(250,250,250);border:=
1px solid rgb(187,187,187);word-wrap:break-word"><code><div><font color=3D"=
#660066"><span style=3D"color:#000">UNIT_TEST_START</span><span style=3D"co=
lor:#660">()</span><span style=3D"color:#000"><br></span></font><span style=
=3D"color:#000">&nbsp; &nbsp; &nbsp;EXPECT</span><span style=3D"color:#660"=
>(</span><span style=3D"color:#000">some predicate</span><span style=3D"col=
or:#660">);</span><span style=3D"color:#000"><br>&nbsp; &nbsp; &nbsp;</span=
><span style=3D"color:#660">...</span><span style=3D"color:#000"> <br></spa=
n><font color=3D"#660066"><span style=3D"color:#000">UNIT_TEST_END</span><s=
pan style=3D"color:#660">()</span></font></div></code></div><br></div><div>=
Unit test after example:</div><div><div style=3D"background-color:rgb(250,2=
50,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code><div>=
<font color=3D"#660066"><span style=3D"color:#000">UNIT_TEST</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#000">__R</span><span style=
=3D"color:#660">(</span><span style=3D"color:#000"><br>&nbsp; &nbsp; &nbsp;=
EXPECT</span><span style=3D"color:#660">(</span><span style=3D"color:#000">=
some predicate</span><span style=3D"color:#660">);</span><span style=3D"col=
or:#000"><br>&nbsp; &nbsp; &nbsp;</span><span style=3D"color:#660">...</spa=
n><span style=3D"color:#000"> <br></span><span style=3D"color:#660">))</spa=
n></font></div></code></div><br>This "raw syntax" would also fix the "comma=
 problem", that forced users to define a "COMMA" macro for years:</div><div=
><div style=3D"background-color:rgb(250,250,250);border:1px solid rgb(187,1=
87,187);word-wrap:break-word"><code><div><font color=3D"#660066"><span styl=
e=3D"color:#000">__R</span><span style=3D"color:#660">(,)</span></font></di=
v></code></div><br><b>What do you think?</b></div></div></blockquote></div>=
</div></blockquote></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_552_24779971.1390169746827--

.
