220 20018 <927D718C-8C9F-488C-8260-4E327DD41E22@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Obtaining the number of arguments of a function
Date: Wed, 26 Aug 2015 07:49:24 +0800
Lines: 97
Approved: news@gmane.org
Message-ID: <927D718C-8C9F-488C-8260-4E327DD41E22@gmail.com>
References: <af0ff3cb-51c3-41fe-a91b-200c9a856045@isocpp.org> <B7BB5AF6-2654-49A8-B4F5-C1364F007F31@gmail.com> <0a8b46d3-4b38-4e1b-ad75-9d18b4697a97@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_68552155-0FEC-4B5C-B48F-CCCBA3FD05F5"
X-Trace: ger.gmane.org 1440546581 17072 80.91.229.3 (25 Aug 2015 23:49:41 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 25 Aug 2015 23:49:41 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBCX66OXAKGQEL6F64AA@isocpp.org Wed Aug 26 01:49:33 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBCX66OXAKGQEL6F64AA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBCX66OXAKGQEL6F64AA@isocpp.org>)
	id 1ZUNy7-0007v1-S0
	for gclcip-std-proposals@m.gmane.org; Wed, 26 Aug 2015 01:49:32 +0200
Original-Received: by iodt126 with SMTP id t126sf355455993iod.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Aug 2015 16:49:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=vBoEnqSRhFo614eKbk1kub7oGQaKPuXTi6WcrArpjNY=;
        b=UAVkKoL8n9/FuZPWRBMeMqKAVEPK1KYowMItQJHv9PuTh3T5+rdf5ORC63kzXN37gW
         lK5RKYRMW0zIs+QFgvH4OteOlU+f/w1g3oYsOHgsEUrjYSlTzKhQCEVzFZeNRpbGD5/q
         atS32ztPGrpZ/3Uu1DepwlakEd0dLvwcwVcrmALW4CM+1+YA8/nULiJ468zgMzcttr48
         ducLq6mZCdymUQ4ZzOIAmV2aJn7HL2HRZr0LswvI2OSozyNeJZLp6WuYBTAV6iCO8rkL
         gGKdNH720bIh+rc2JB3v788tTefTAXRfUrmeNg8QNkDf7RvB9l8SnQrHTR+DxTbc3W+A
         v4Cw==
X-Gm-Message-State: ALoCoQn2G82ShHaN+SUaIaa++cQ2JPYzGv9WbWEsemkvG4lT9SMzW0lmKo9C/+i6QXMfZZl04imh
X-Received: by 10.50.50.179 with SMTP id d19mr5527899igo.6.1440546570955;
        Tue, 25 Aug 2015 16:49:30 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.150.7 with SMTP id y7ls299977iod.90.gmail; Tue, 25 Aug
 2015 16:49:30 -0700 (PDT)
X-Received: by 10.66.122.207 with SMTP id lu15mr61948104pab.146.1440546570280;
        Tue, 25 Aug 2015 16:49:30 -0700 (PDT)
Original-Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com. [2607:f8b0:400e:c03::231])
        by mx.google.com with ESMTPS id fp17si11970494pdb.150.2015.08.25.16.49.30
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 25 Aug 2015 16:49:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::231 as permitted sender) client-ip=2607:f8b0:400e:c03::231;
Original-Received: by pacti10 with SMTP id ti10so66446834pac.0
        for <std-proposals@isocpp.org>; Tue, 25 Aug 2015 16:49:30 -0700 (PDT)
X-Received: by 10.66.62.202 with SMTP id a10mr62190716pas.42.1440546570132;
        Tue, 25 Aug 2015 16:49:30 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.91])
        by smtp.gmail.com with ESMTPSA id bu10sm22461986pac.36.2015.08.25.16.49.28
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Aug 2015 16:49:29 -0700 (PDT)
In-Reply-To: <0a8b46d3-4b38-4e1b-ad75-9d18b4697a97@isocpp.org>
X-Mailer: Apple Mail (2.2098)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c03::231 as permitted
 sender) smtp.mailfrom=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=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: <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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:20018
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20018>

--Apple-Mail=_68552155-0FEC-4B5C-B48F-CCCBA3FD05F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9308=E2=80=9326, at 7:21 AM, Sean Middleditch <sean.middled=
itch@gmail.com> wrote:
>=20
> This is just one piece of boost function_traits (http://www.boost.org/doc=
/libs/1_57_0/libs/type_traits/doc/html/boost_typetraits/reference/function_=
traits.html) combined with the utility to convert various forms of function=
 pointer into the "function type" needed by function_traits (e.g. https://f=
unctionalcpp.wordpress.com/2013/08/05/function-traits/)
>=20
> Very useful for script binding and general runtime reflection systems, am=
ong other things. Take a look at libraries like luabind or one of its umpte=
en bazillion alternatives for examples of where it can be useful.
>=20
> Suuuper common need in games at the very least, and I'm sure many other p=
laces.
>=20
> Would be nice to have function_traits in the standard.

The standard should be self-consistent. All the features should support the=
 other features.

If you=E2=80=99re only interested in function signature types of the form R=
et(Arg1, <=E2=80=A6>, ArgN), then as the blog post says, the signatures eas=
ily map to and from tuples. Perhaps there should be a facility for doing th=
at mapping. But it shouldn=E2=80=99t be called function_traits because such=
 a name would suggest much broader functionality.

--=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/.

--Apple-Mail=_68552155-0FEC-4B5C-B48F-CCCBA3FD05F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=
=E2=80=9326, at 7:21 AM, Sean Middleditch &lt;<a href=3D"mailto:sean.middle=
ditch@gmail.com" class=3D"">sean.middleditch@gmail.com</a>&gt; wrote:</div>=
<br class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">Thi=
s is just one piece of boost function_traits (<a href=3D"http://www.boost.o=
rg/doc/libs/1_57_0/libs/type_traits/doc/html/boost_typetraits/reference/fun=
ction_traits.html" class=3D"">http://www.boost.org/doc/libs/1_57_0/libs/typ=
e_traits/doc/html/boost_typetraits/reference/function_traits.html</a>) comb=
ined with the utility to convert various forms of function pointer into the=
 "function type" needed by function_traits (e.g.&nbsp;<a href=3D"https://fu=
nctionalcpp.wordpress.com/2013/08/05/function-traits/" class=3D"">https://f=
unctionalcpp.wordpress.com/2013/08/05/function-traits/</a>)</div><div class=
=3D""><br class=3D""></div><div class=3D"">Very useful for script binding a=
nd general runtime reflection systems, among other things. Take a look at l=
ibraries like luabind or one of its umpteen bazillion alternatives for exam=
ples of where it can be useful.</div><div class=3D""><br class=3D""></div><=
div class=3D"">Suuuper common need in games at the very least, and I'm sure=
 many other places.<br class=3D""></div><div class=3D""><br class=3D""></di=
v><div class=3D"">Would be nice to have function_traits in the standard.</d=
iv></div></blockquote><br class=3D""></div><div>The standard should be self=
-consistent. All the features should support the other features.</div><div>=
<br class=3D""></div><div>If you=E2=80=99re only interested in function sig=
nature types of the form <font face=3D"Courier" class=3D"">Ret(Arg1, &lt;=
=E2=80=A6&gt;, ArgN)</font>, then as the blog post says, the signatures eas=
ily map to and from tuples. Perhaps there should be a facility for doing th=
at mapping. But it shouldn=E2=80=99t be called <font face=3D"Courier" class=
=3D"">function_traits</font> because such a name would suggest much broader=
 functionality.</div><div><br class=3D""></div></body></html>

<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 />

--Apple-Mail=_68552155-0FEC-4B5C-B48F-CCCBA3FD05F5--

.
