On Saturday, 20 July 2013 at 19:04:29 UTC, Jesse Phillips wrote:
On Saturday, 20 July 2013 at 18:53:44 UTC, JS wrote:
if they want to allow the same op in there class, which they
probably do, they have to override the long hand anyways and
redirect.
Nope, that is why you make the template fin
On Saturday, 20 July 2013 at 18:53:44 UTC, JS wrote:
if they want to allow the same op in there class, which they
probably do, they have to override the long hand anyways and
redirect.
Nope, that is why you make the template final and forwards, all
derived classes will be able to instantiate
On Saturday, 20 July 2013 at 18:34:30 UTC, Jesse Phillips wrote:
On Saturday, 20 July 2013 at 16:46:52 UTC, JS wrote:
class MyClass {
auto opBinary(string op : "|" T : int)(T t) { }
// opBinary is completely specialized and is no
different than a regular f
On Saturday, 20 July 2013 at 16:46:52 UTC, JS wrote:
class MyClass {
auto opBinary(string op : "|" T : int)(T t) { }
// opBinary is completely specialized and is no
different than a regular function, it can be overridden
directly in children without havin
On Saturday, 20 July 2013 at 13:27:03 UTC, H. S. Teoh wrote:
On Sat, Jul 20, 2013 at 12:13:49PM +0200, JS wrote:
On Saturday, 20 July 2013 at 01:37:13 UTC, Jesse Phillips
wrote:
>The relevant blog post:
>
>http://3d.benjamin-thaut.de/?p=94
>
>What you should understand is template functions are
On Sat, Jul 20, 2013 at 12:13:49PM +0200, JS wrote:
> On Saturday, 20 July 2013 at 01:37:13 UTC, Jesse Phillips wrote:
> >The relevant blog post:
> >
> >http://3d.benjamin-thaut.de/?p=94
> >
> >What you should understand is template functions are not/can not
> >be virtual. They do not exist until t
On Saturday, 20 July 2013 at 01:37:13 UTC, Jesse Phillips wrote:
The relevant blog post:
http://3d.benjamin-thaut.de/?p=94
What you should understand is template functions are not/can
not be virtual. They do not exist until they are instantiated.
Thus you can not require that they be overload
The relevant blog post:
http://3d.benjamin-thaut.de/?p=94
What you should understand is template functions are not/can not
be virtual. They do not exist until they are instantiated. Thus
you can not require that they be overloaded.
On Fri, Jul 19, 2013 at 04:28:42PM +0200, Adam D. Ruppe wrote:
> You can't have templates in interfaces unless they are final,
> otherwise it won't work right.
>
> The way I'd do it is is make the op template final, and have it
> forward to another normal virtual function:
>
> interface Addable {
You can't have templates in interfaces unless they are final,
otherwise it won't work right.
The way I'd do it is is make the op template final, and have it
forward to another normal virtual function:
interface Addable {
final Addable opBinary(string op : "+")(Addable rhs) {
return
I would like to require any implementation of an interface to
override
import std.stdio, std.cstream;
interface A
{
void opOpAssign(string op : "^")(int c);
}
class B : A
{
int x;
void opOpAssign(string op : "+")(int c) { x = c; }
// Note it uses +
}
void main(
11 matches
Mail list logo