Topic: decltype(myself)


Author: BetaNona <betanona@gmail.com>
Date: Fri, 7 Aug 2009 12:00:28 CST
Raw View
I see. f is not declared at the left of -> .
Thank you.

Thus, is this well-form?
At decltype, f is not declared and so not overloaded.

void *f(int);
auto f() -> decltype(&f) {return 0;}

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: Mathias Gaunard <loufoque@gmail.com>
Date: Sat, 8 Aug 2009 09:55:06 CST
Raw View
On 7 ao   t, 20:00, BetaNona <betan...@gmail.com> wrote:

> Thus, is this well-form?
> At decltype, f is not declared and so not overloaded.
>
> void *f(int);
> auto f() -> decltype(&f) {return 0;}

Yes, this is well formed.
This is equivalent to

void* (*f())(int) { return 0; }


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: BetaNona <betanona@gmail.com>
Date: Tue, 4 Aug 2009 13:16:44 CST
Raw View
What is the type of f ?

auto f() -> decltype(&f) {return f;}

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: Mathias Gaunard <loufoque@gmail.com>
Date: Tue, 4 Aug 2009 19:11:44 CST
Raw View
On 4 ao   t, 21:16, BetaNona <betan...@gmail.com> wrote:
> What is the type of f ?
>
> auto f() -> decltype(&f) {return f;}

This code is ill-formed.
f is not in scope in decltype(&f).


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: Sean Hunt <rideau3@gmail.com>
Date: Wed, 5 Aug 2009 15:19:41 CST
Raw View
On Aug 4, 1:16 pm, BetaNona <betan...@gmail.com> wrote:
> What is the type of f ?
>
> auto f() -> decltype(&f) {return f;}

At first glance, that seems ill-formed because f isn't declared until
after the late-specified return type.


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]