This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/28385] templated function call goes awry



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]