I understand about not supporting selector for templates. But mixin template should not even be considered template as it only inserts the code where it is.
Objective c has a bind boilerplate code while defining the alloc/init, and it can even be simplified by using the following mixin:
```d
mixin template ObjectiveCOpCall()
{
extern(Objective-C) override static typeof(this) alloc() @selector("alloc")
extern(Objective-C) override typeof(this) init() @selector("init");
extern(D) final static typeof(this) opCall(){return alloc.init;}
}
extern(Objective-C):
extern class NSObject
{
static NSObject alloc() @selector("alloc");
NSObject init() @selector("init");
}
extern class MTLRenderPassColorDescriptor : NSObject
{
mixin ObjectiveCOpCall();
}
```
Comment #1 by robert.schadek — 2024-12-13T19:27:39Z