Re: auto attribute for interface functions

2013-10-09 Thread Jonathan M Davis
On Wednesday, October 09, 2013 16:13:48 Roman wrote: > > In fact, since the template could be in a library, and code > > could use that library well after the library has been > > written... > > As such, there is a fundamental conflict between how templates > > work and how virtual functions work.

Re: auto attribute for interface functions

2013-10-09 Thread Roman
In fact, since the template could be in a library, and code could use that library well after the library has been written... As such, there is a fundamental conflict between how templates work and how virtual functions work. They just don't mix. Seems, the same problem doesn't allow auto attr

Re: auto attribute for interface functions

2013-10-08 Thread Jesse Phillips
On Tuesday, 8 October 2013 at 13:40:47 UTC, Roman wrote: ``` interface I { //auto foo(int i); //forbidden auto bar(T)(T i); //Error: function a.I.bar!(int).bar has no function body with return type inference } Basically the error on the template answers your statement, bar has no i

Re: auto attribute for interface functions

2013-10-08 Thread Jonathan M Davis
On Tuesday, October 08, 2013 17:26:04 Roman wrote: > Seems, I've tried to use virtual templates manner. But it doesn't > realizes in D yet Fundamentally, making templates virtual doesn't really work. If it's possible, it would be quite difficult, and AFAIK, it's impossible. Templated functions a

Re: auto attribute for interface functions

2013-10-08 Thread Roman
On Tuesday, 8 October 2013 at 13:40:47 UTC, Roman wrote: ``` interface I { //auto foo(int i); //forbidden auto bar(T)(T i); //Error: function a.I.bar!(int).bar has no function body with return type inference } class A:I { int foo(int i) { return i;