Topic: Fallback behavior for "T..." => {} when T is not
Author: Johannes Schaub <schaub.johannes@googlemail.com>
Date: Thu, 20 Mar 2014 00:46:47 +0100
Raw View
This has confused me initially
template<typename ...T>
void f(void (*)(T...));
void g();
void g(int);
int main() {
f(g);
}
It actually compiles and passes the "g()" overload. In my opinion,
this is counter intuitive and should instead cause an ambiguity with
regard to argument "g". How can this situation be improved?
--
---
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/.
.
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 19 Mar 2014 21:01:30 -0400
Raw View
On Wed, Mar 19, 2014 at 7:46 PM, Johannes Schaub
<schaub.johannes@googlemail.com> wrote:
> This has confused me initially
>
> template<typename ...T>
> void f(void (*)(T...));
>
> void g();
> void g(int);
>
> int main() {
> f(g);
> }
>
> It actually compiles and passes the "g()" overload. In my opinion,
> this is counter intuitive and should instead cause an ambiguity with
> regard to argument "g". How can this situation be improved?
Forget about the specific callable type like function
pointer, use an invocation type traits.
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
--
---
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/.
.