opCast + dtor error

vit vit at vit.vit
Tue Dec 28 18:27:36 UTC 2021


Hi, why this code doesn't compile?

```d
struct Foo{
     bool opCast(T : bool)()const{
         assert(0);
     }

     ~this(){}
}

struct Bar{
     const Foo foo;
}

void main(){


}
```

Error: template instance `opCast!(Foo)` does not match template 
declaration `opCast(T : bool)()`





More information about the Digitalmars-d-learn mailing list