Topic: type signatures or constraints for callable
Author: Thiago Macieira <thiago@macieira.org>
Date: Sun, 08 Sep 2013 11:23:56 -0700
Raw View
--nextPart1789990.jYEky4ESJk
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
On domingo, 8 de setembro de 2013 04:13:11, snk_kid wrote:
> type signatures or constraints for callable entity type parameters
>
> Something I'd like to see fixed in the near future is being able to specify
> in the type system (and also get documentation-for-free) is what the
> parameters & return type must be of a callable entity template parameter.
> What I mean by this is currently when writing a higher-order function in
> C++ such as:
>
> template < typename Function >
> void foo(Function bar);
>
> Without looking at the definition of 'foo' or without documentation it is
> impossible to tell what kind of parameters/return type is expected of 'fn'.
>
> Maybe a template constraint such as this would be possible:
>
> template< typename Fn > requires Function<Fn, void (int,int) >()
> void foo(Fn bar);
That's concepts-lite. Can you write your proposal in terms of what needs to be
added to the language on top of concepts-lite?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--nextPart1789990.jYEky4ESJk
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iD8DBQBSLMDXM/XwBW70U1gRAnpZAKCcOb9uBxt5NnXYg11S0IQDm8mf8ACgndIc
gBcNyL8htq4rKdXMPQI32c0=
=yNpL
-----END PGP SIGNATURE-----
--nextPart1789990.jYEky4ESJk--
.
Author: Xeo <hivemaster@hotmail.de>
Date: Sun, 8 Sep 2013 11:43:21 -0700 (PDT)
Raw View
------=_Part_1110_25764164.1378665801309
Content-Type: text/plain; charset=ISO-8859-1
On Sunday, September 8, 2013 8:23:56 PM UTC+2, Thiago Macieira wrote:
>
>
> That's concepts-lite. Can you write your proposal in terms of what needs
> to be
> added to the language on top of concepts-lite?
>
Polymorphic type variables, likely. Something that lets you say
"Callable<F, auto(auto, auto)>", for example. Really don't know how
feasible that would be in C++.
--
---
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_1110_25764164.1378665801309
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, September 8, 2013 8:23:56 PM UTC+2, Thiago Maci=
eira wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><br>That's concepts=
-lite. Can you write your proposal in terms of what needs to be=20
<br>added to the language on top of concepts-lite?
<br></blockquote><div><br>Polymorphic type variables, likely. Something tha=
t lets you say "Callable<F, auto(auto, auto)>", for example. Really d=
on't know how feasible that would be in C++.<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_1110_25764164.1378665801309--
.