auto ref and non-templated functions

Jonathan M Davis jmdavisProg at gmx.com
Mon Dec 24 12:30:46 PST 2012


On Monday, December 24, 2012 20:43:06 Robert Clipsham wrote:
> Is:
> 
> auto foo()(auto ref S e) { /* do stuff */ }
> 
> So hard to write?
> 
> (It's Christmas Eve, and I can't be bothered giving real
> arguments against right now - I suppose someone else will do this
> later... Merry Christmas!)

If nothing else, it doesn't work for classes, because templated functions 
can't be virtual. Also, it forces you to put the entire function's 
implementation in a .di file if you use .di files, which makes it untentable for 
many of the folks who actually need to use .di files.

We need a solution which doesn't involve templates.

- Jonathan M Davis


More information about the Digitalmars-d mailing list