This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28385] templated function call goes awry
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2006 13:40:15 -0000
- Subject: [Bug c++/28385] templated function call goes awry
- References: <bug-28385-12959@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2006-07-18 13:40 -------
(In reply to comment #0)
> Everyone knows that in C, "&function_name" and "function_name" are generally
> equivalent-- you can write:
> func_ptr_type* f = &function_name;
> or
> func_ptr_type* f = function_name;
>
> So it is surprising to me that
> myFoo(bar);
> seems to behave differently than:
> myFoo(&bar);
The difference is that C++ has references whereas C doesn't. 'bar' has type
'reference to function', whereas '&bar' is 'pointer to function'.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28385