On Wednesday, 13 January 2016 at 12:39:36 UTC, Jacob Carlborg
wrote:
On 2016-01-13 10:48, Shriramana Sharma wrote:
This is not what alias <> this is supposed to do, right?
No.
So how am I supposed to get the mixed in ctors work?
Looks like a limitation in the language.
This works:
mixin template myCtors()
{
this(int i) {}
this(char c) {}
}
struct Test
{
this(string s) {}
mixin myCtors mixed;
alias __ctor = mixed.__ctor;
}
void main()
{
auto a = Test("hello");
auto b = Test(1);
auto c = Test('c');
}