DIP27 available for destruction

Jonathan M Davis jmdavisProg at gmx.com
Tue Feb 26 22:05:56 PST 2013


On Wednesday, February 27, 2013 03:23:04 deadalnix wrote:
> On Tuesday, 26 February 2013 at 20:00:26 UTC, Jonathan M Davis
> 
> wrote:
> > Wouldn't this fall apart completely with auto or IFTI (implicit
> > funtion
> > template instantiation)? For instance take
> > 
> > auto foo(T)(T blah) {...}
> > 
> > int func() { return 7; }
> > 
> > void bar()
> > {
> > 
> >  ...
> >  foo(func); //Does this call func or pass its address?
> >  auto f = func; //Does this call func or take its address?
> >  ...
> > 
> > }
> 
> Both are the function. None is listed in the implicit call cases.
> Are you sure we are talking about the same DIP ?

Then what happened to parenless function calls? _Both_ of the cases above need 
to call the function, or you're going to be breaking tons of code, and I see 
_zero_ useability gain here. The function's name by itself calls the function. 
& on the function's name gets its address. What's complicated about that? What 
we have right now with regards to functions and their addresses is incredibly 
straightforward, and I don't see any gains in simplifying it. It just sounds 
like you're killing parenless function calls for free functions outside of 
UFCS. What are you even trying to gain by making it so that a function's name 
and its address are conflated like this?

- Jonathan M Davis


More information about the Digitalmars-d mailing list