220 8030 <641963d1-19b9-466c-a952-079344e9ff87@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: "R. Martinho Fernandes" <martinho.fernandes@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: A proposal to add call traits to the Standard Library
Date: Thu, 5 Dec 2013 03:01:11 -0800 (PST)
Lines: 107
Approved: news@gmane.org
Message-ID: <641963d1-19b9-466c-a952-079344e9ff87@isocpp.org>
References: <e40266b1-2fe8-45a7-afda-f0ec272c14ec@isocpp.org> <ff23685b-f536-40a7-9756-2aa3f33eec4c@isocpp.org>
 <CABsf5r02yaaP45MZfFnbMUpJa629gD6TXMgWkSJArVnPZVNTWQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1290_29226541.1386241271742"
X-Trace: ger.gmane.org 1386241271 21423 80.91.229.3 (5 Dec 2013 11:01:11 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 5 Dec 2013 11:01:11 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDXL3FEUYQARB6FZQGKQKGQENWR5OUI@isocpp.org Thu Dec 05 12:01:17 2013
Return-path: <std-proposals+bncBDXL3FEUYQARB6FZQGKQKGQENWR5OUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDXL3FEUYQARB6FZQGKQKGQENWR5OUI@isocpp.org>)
	id 1VoWgF-0000zI-Eq
	for gclcip-std-proposals@m.gmane.org; Thu, 05 Dec 2013 12:01:15 +0100
Original-Received: by mail-pd0-f197.google.com with SMTP id v10sf47003420pde.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Dec 2013 03:01:13 -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=KzXmiOQDRqytynLwwbrRTh6S4O9EI+jQcPjQV0MVtHw=;
        b=jA6wGLHaUHHcl50wZJby2FmVaCA5BQmvmPHp3pwBfNfw94PQZNHj2cLgkcMRuj6F8S
         rNWZ8c5dHBFMcIhkSlgdsHC3VmHVhR6snvIRs0YAp9Dj9PUW6I2rudPZa3J+kKESFV9G
         suBJOJnOuxU1YFOK/qnXAs2b6WezivStcTQCKZ/E8eLqsZxVyv8tpTYSrIgA5NcQ8lQ4
         Y1RXj/6ffpBtCsWwhi13u7N/CA2+93jgdCdAPDcaZVanWRM51iYrw2ugK92pw3qO1WzC
         oHJA/enSGhEKUNDhm522mGGDcVpN6cASId8p4+PntPRqCNZhU20CVZMDUkKTuyaknhKE
         VLsg==
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=KzXmiOQDRqytynLwwbrRTh6S4O9EI+jQcPjQV0MVtHw=;
        b=EqBMzhO1ZrwtXCnmeWSv/uKN4dYG1J77bFSsh+2m4AJxlAc5gbcCsC9VVH6XsX9JhJ
         nicjByZuJgFdbm6f2i/nfQuXVdI0O8RLtT26PQdTSFtWgPxZmFHR6Voz7zLOgj5he08I
         DFy3vhjtRlcP7Rgfy+1iX5Puq1R6eHOlcykPqxpASSpDOjMvQdqGaEOSdOmqpYBmw/pM
         djs0E6kpKYuFwyzr9gJMExC3OZ4EdXvdbP/lHqkTeWoWWUvRlODcq/xjh+d0HGnURIUU
         bFm5vJ8Q8HwVKeW4MCLe1yDlZDspjCt4ohiFbDMYg35UxJ1d4zKjzWiB8Hn3s7iSvGPp
         GLXQ==
X-Gm-Message-State: ALoCoQkK+plFmVMiXYymURoXx0PxBryfhXdnQQga3y5kQz0HC2Sa+xgQ4wn1SGZa/nJoLpsLG+iu
X-Received: by 10.66.153.137 with SMTP id vg9mr47719pab.43.1386241273340;
        Thu, 05 Dec 2013 03:01:13 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.84.234 with SMTP id c10ls578949qez.50.gmail; Thu, 05 Dec
 2013 03:01:12 -0800 (PST)
X-Received: by 10.49.25.103 with SMTP id b7mr41099qeg.19.1386241272405;
        Thu, 05 Dec 2013 03:01:12 -0800 (PST)
In-Reply-To: <CABsf5r02yaaP45MZfFnbMUpJa629gD6TXMgWkSJArVnPZVNTWQ@mail.gmail.com>
X-Original-Sender: martinho.fernandes@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:8030
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8030>

------=_Part_1290_29226541.1386241271742
Content-Type: text/plain; charset=ISO-8859-1

On Thursday, December 5, 2013 4:35:00 AM UTC+1, Joshua Boyce wrote:
>
> On Wed, Dec 4, 2013 at 9:23 PM, R. Martinho Fernandes <
> martinho....@gmail.com <javascript:>> wrote:
>
>> I have written a lot of generic code that uses callable objects and I 
>> never needed this, so I got curious about the use cases (i.e. that "I must 
>> be missing something" feeling). However the proposal document does not 
>> provide an example. It provides an artificial example of usage, but that 
>> isn't convincing because "You can use it to demonstrate the feature 
>> featured in this proposal" is not an interesting example.
>>
>>  
> I use my own implementation of something like this in what is effectively 
> a JIT wrapper. (I take a C++ function pointer plus the args to call it 
> with, and then inspect the arity/parameter types/return type to generate 
> assembly code on the fly -- using a JIT library (AsmJit) with a more 'C 
> with Classes' style interface -- which is then injected into another 
> process.
>

To support non-overloaded function pointers there's no need for traits.

template <typename R, typename... A>
void f(R(*)(A...));


-- 

--- 
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_1290_29226541.1386241271742
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, December 5, 2013 4:35:00 AM UTC+1, Joshua Boy=
ce wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div><div class=3D"gm=
ail_quote">On Wed, Dec 4, 2013 at 9:23 PM, R. Martinho Fernandes <span dir=
=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailt=
o=3D"OGZI5FoELvwJ" onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;">martinho....@gmail.com</a=
>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr"><div>I have written a lot of generic code=
 that uses callable objects and I never needed this, so I got curious about=
 the use cases (i.e. that "I must be missing something" feeling). However t=
he proposal document does not provide an example. It provides an artificial=
 example of usage, but that isn't convincing because "You can use it to dem=
onstrate the feature featured in this proposal" is not an interesting examp=
le.<br>

</div><div><div><br></div></div></div></blockquote><div>&nbsp;</div></div><=
div>I use my own implementation of something like this in what is effective=
ly a JIT wrapper. (I take a C++ function pointer plus the args to call it w=
ith, and then inspect the arity/parameter types/return type to generate ass=
embly code on the fly -- using a JIT library (AsmJit) with a more 'C with C=
lasses' style interface -- which is then injected into another process.</di=
v></div></blockquote><div><br>To support non-overloaded function pointers t=
here's no need for traits.<br><br><div class=3D"prettyprint" style=3D"backg=
round-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-s=
tyle: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pret=
typrint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">template</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">typename</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> R</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">typename</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">...</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> A</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> f</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">R</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(*)(<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">A</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">...));</span></div><=
/code></div><br><br></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_1290_29226541.1386241271742--

.
