220 8689 <c0398870-b265-4d02-a814-ad84a472520c@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Vittorio Romeo <vittorio.romeo.vee@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: "Raw" preprocessor macro arguments
Date: Sun, 19 Jan 2014 09:28:43 -0800 (PST)
Lines: 327
Approved: news@gmane.org
Message-ID: <c0398870-b265-4d02-a814-ad84a472520c@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_333_8680371.1390152523746"
X-Trace: ger.gmane.org 1390152523 20288 80.91.229.3 (19 Jan 2014 17:28:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 19 Jan 2014 17:28:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO3NDEYZQHRBTEW6CLAKGQEEHJUAZI@isocpp.org Sun Jan 19 18:28:50 2014
Return-path: <std-proposals+bncBCO3NDEYZQHRBTEW6CLAKGQEEHJUAZI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO3NDEYZQHRBTEW6CLAKGQEEHJUAZI@isocpp.org>)
	id 1W4wAv-0004bo-Vq
	for gclcip-std-proposals@m.gmane.org; Sun, 19 Jan 2014 18:28:46 +0100
Original-Received: by mail-ob0-f198.google.com with SMTP id wp4sf6107847obc.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 19 Jan 2014 09:28:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id: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=gXoCW0g4BoTM9vDPveQkKvtxcfLZj/a/l8stn7D9RAE=;
        b=pTq3xz1hs/s29/tHCmnw2JdUsPc589V7VjPoJ+hrEli7TChK74h2zlcHyP/sFyQ5Sf
         5TIqhriMN2nc8IaE6mEzws310/xc0KdsCTPG9hs0uHtpEvDHUerjUEwoZ+f1SsMMOUZl
         xsecIwNlHwoMrkDhDb0YiWtVK6RgGWLWpLiM72T/hnV0ZheOGarhi3MelI1VUN7v7nB7
         IUA+uSzYG3Z3KJej4ePBIY5pLVFJyE2/rEt/Za1YHJEbe+5r6RF2kskzBrImAU2v1Re+
         QrgsiSPPpaWIZuZhdZR1USZNYZzz4EOsDm3SKrQJBZXBsxdZoezU/ZF7dL65a8Uw8+gl
         dAvA==
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: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=gXoCW0g4BoTM9vDPveQkKvtxcfLZj/a/l8stn7D9RAE=;
        b=mLXeFPfMB8o3sWQUldA1gCbCvHk3n5pGkC70W0pL5G9lsvK3CCF55Z/YVNe3D4yarP
         lYugymVQmWLEO804ecwKPJRppFmL+gWyef1SCfRnHK7XchdIQ+d86rPBOlwHyjtl2vKP
         dLOK+IA5WZmk3egZfQS7jZhxvibUoX3gyU1UDfDjiBAjLFyz0G7axVAEYUxfpwap86fX
         xlhSwxycJSnCeapsUDrt4ax7h1tGjiPhLTVME9E8Vg90ZloS0hpjlQu39PqKPLgjNEyJ
         0QIlh1mqLX75jfW06aMOD4g85Qivz6tBqTl5Ga8N/jujX5RpkohTg2eeoaJYbWUjBsQW
         pxng==
X-Gm-Message-State: ALoCoQmIhgfymMgT4rDFfg1q/xciuLEh3y/vTR99wmYKVxZINdBEgVRQxqmx8R11gkMYTNYaUBNk
X-Received: by 10.43.4.4 with SMTP id oa4mr4346906icb.2.1390152525020;
        Sun, 19 Jan 2014 09:28:45 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.39.102 with SMTP id o6ls1628032qek.28.gmail; Sun, 19 Jan
 2014 09:28:44 -0800 (PST)
X-Received: by 10.140.43.74 with SMTP id d68mr183928qga.8.1390152524329;
        Sun, 19 Jan 2014 09:28:44 -0800 (PST)
X-Original-Sender: vittorio.romeo.vee@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:8689
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8689>

------=_Part_333_8680371.1390152523746
Content-Type: text/plain; charset=UTF-8

*Preprocessor macros*, even if potentially *unsafe*, still have place in a 
lot of C/C++ programs. Using macros is the sometimes only way to avoid 
verbose code repetition, to simulate static reflection or to generate code 
that would be impossible to generate only using templates.
An issue with macros is that passing arguments is sometimes really 
counter-intuitive and dangerous. 

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 
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 is 
invalid, as 
// the round parenthesis persist in the return type (look below for the 
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 specific 
to this case, and may not always be applicable. Additionally, it requires 
the coder to define a new typedef,
2. Create multiple macros (for example, GENERATE_FUNC_START and 
GENERATE_FUNC_END), and 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 macro definitions.

These solutions, however, can be defined *hacks. *The issue is that there 
is no way to pass a "raw" argument to the preprocessor. 

Here's what I propose:
*Similarly to C++11 raw strings, have a new syntax that allows the user 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> 

Prefix/suffix example:
GENERATE_FUNC(__R***(ReturnType(int*))***, __R(getIntPtr), __R(return &
someInt;))

Unit test before example:
UNIT_TEST_START()
     EXPECT(some predicate);
     ... 
UNIT_TEST_END()

Unit test after example:
UNIT_TEST(__R(
     EXPECT(some predicate);
     ... 
))

This "raw syntax" would also fix the "comma problem", that forced users to 
define a "COMMA" macro for years:
__R(,)

*What do you think?*

-- 

--- 
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_333_8680371.1390152523746
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><b>Preprocessor macros</b>,&nbsp;even if potentially&nbsp;=
<i>unsafe</i>, still have place in a lot of C/C++ programs. Using macros is=
 the sometimes only way to avoid verbose code repetition, to simulate stati=
c reflection or to generate code that would be impossible to generate only =
using templates.<div>An issue with macros is that passing arguments is some=
times really counter-intuitive and dangerous.&nbsp;<br><br>Example:</div><d=
iv><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250)=
; border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #800;"=
 class=3D"styled-by-prettify">#define</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> GENERATE_FUNC</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">mType</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> mName</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> mB=
ody</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> mType mName</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">(){</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> mBody </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br><br><br></span><span style=3D=
"color: #800;" class=3D"styled-by-prettify">// Ok, generates valid code</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>GENERATE_F=
UNC</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> printHi</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> printf</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">(</span><span style=3D"color: #080;" class=3D=
"styled-by-prettify">"hi"</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">);)</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br><br><br></span><span style=3D"color: #800;" class=3D"styled-by-=
prettify">// Ok, generates valid code</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>GENERATE_FUNC</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">void</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> printNumber</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> printf</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #080;" class=3D"styled-by-prettify">"%d"</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">5</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">);)</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #800;" c=
lass=3D"styled-by-prettify">// The comma in "&lt;int, int&gt;" is read as a=
n additional argument - macro expansion fails</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>GENERATE_FUNC</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">pair</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">int</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&gt;,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> getPair1</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">make_pair</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">);)</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #80=
0;" class=3D"styled-by-prettify">// The comma in "&lt;int, int&gt;" is read=
 correctly, but the generated code is invalid, as </span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #8=
00;" class=3D"styled-by-prettify">// the round parenthesis persist in the r=
eturn type (look below for the expansion)</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>GENERATE_FUNC</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">((</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">pair</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">int</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;),</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> getPair2</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">make_pair</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">);)</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br></span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">/*<br>&nbsp; &nbsp; (std::pair&lt;int, int&gt;) get=
Pair2() { return std::make_pair(1, 1); }<br>*/</span></div></code></div><di=
v><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 specifi=
c to this case, and may not always be applicable. Additionally, it requires=
 the coder to define a new typedef,<div>2. Create multiple macros (for exam=
ple, GENERATE_FUNC_START and GENERATE_FUNC_END), and let the user write the=
 code in-between - this solution is ugly and error prone. Also, it scales p=
oorly, as k "body" arguments would require k+1 macro definitions.</div><div=
><br></div><div>These solutions, however, can be defined <i>hacks. </i>The =
issue is that there is no way to pass a "raw" argument to the preprocessor.=
&nbsp;</div><div><br></div><div>Here's what I propose:</div><div><b>Similar=
ly to C++11 raw strings, have a new syntax that allows the user to pass "ra=
w arguments" to preprocessor macros.</b></div><div><br></div><div>Example:<=
/div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 25=
0, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><cod=
e class=3D"prettyprint"><div class=3D"subprettyprint"><font color=3D"#00000=
0"><span style=3D"color: #000;" class=3D"styled-by-prettify">GENERATE_FUNC<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">__R</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">std</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">pair</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">int</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&gt;),</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> __R</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">getPairRaw</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">),</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> __R</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">return</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">mak=
e_pair</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</s=
pan><span style=3D"color: #066;" class=3D"styled-by-prettify">1</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
066;" class=3D"styled-by-prettify">1</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">))</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br></span></font></div></code></div><br>Specification:</=
div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250=
, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code=
 class=3D"prettyprint"><div class=3D"subprettyprint"><font color=3D"#660066=
"><span style=3D"color: #000;" class=3D"styled-by-prettify">&lt; __R &gt; <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">&lt;prefix&=
gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> &lt;(&=
gt; &lt;...&gt; &lt;)&gt; </span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">&lt;suffix&gt;</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span></font></div></code></div><br>Prefix/suffix exa=
mple:</div><div><div class=3D"prettyprint" style=3D"background-color: rgb(2=
50, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;=
"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"=
color: #000;" class=3D"styled-by-prettify">GENERATE_FUNC</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">__R</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">***(</span><span style=3D"color: #606;" clas=
s=3D"styled-by-prettify">ReturnType</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">int</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">*))***,</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> __R</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">getIntPtr=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">),</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> __R</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">return</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&amp;</span><font color=3D"#006666"><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">someInt</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;))</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span></font></div></code></di=
v><br></div><div>Unit test before example:</div><div><div class=3D"prettypr=
int" style=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(1=
87, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><font color=3D"#660066"><span style=3D"color: #000;" =
class=3D"styled-by-prettify">UNIT_TEST_START</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span></font><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">&nbsp; &nbsp; &nbsp;EXPECT</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">some predicate</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp;</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> <br></span><font color=3D"#660066"><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">UNIT_TEST_END</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span></font>=
</div></code></div><br></div><div>Unit test after example:</div><div><div c=
lass=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); border:=
 1px solid rgb(187, 187, 187); word-wrap: break-word;"><code class=3D"prett=
yprint"><div class=3D"subprettyprint"><font color=3D"#660066"><span style=
=3D"color: #000;" class=3D"styled-by-prettify">UNIT_TEST</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">__R</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp;EXPECT</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">some predicate</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp;</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">...</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> <br></span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">))</span></font></div></code></div><br>T=
his "raw syntax" would also fix the "comma problem", that forced users to d=
efine a "COMMA" macro for years:</div><div><div class=3D"prettyprint" style=
=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187, 1=
87); word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><font color=3D"#660066"><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">__R</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(,)</span></font></div></code></div><br><b>What do you think?</=
b></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_333_8680371.1390152523746--

.
