On Friday, 12 May 2017 at 00:20:13 UTC, سليمان السهمي (Soulaïman
Sahmi) wrote:
Is there a rational behind not allowing statements inside mixin
templates? I know mixin does accept code containing statements,
but using mixin is much uglier. so I was wondering.
example use case:
//--
On Friday, 12 May 2017 at 20:51:17 UTC, سليمان السهمي (Soulaïman
Sahmi) wrote:
On Friday, 12 May 2017 at 00:20:13 UTC, سليمان السهمي
(Soulaïman Sahmi) wrote:
Is there a rational behind not allowing statements inside
mixin templates? ...
I guess the answer is, nobody has written a DIP for it?
On Friday, 12 May 2017 at 00:20:13 UTC, سليمان السهمي (Soulaïman
Sahmi) wrote:
Is there a rational behind not allowing statements inside mixin
templates? ...
I guess the answer is, nobody has written a DIP for it?
On Friday, 12 May 2017 at 08:47:32 UTC, visitor wrote:
works for me :
mixin template testBoilerPlate(alias arg, alias expected)
{
auto doit = {
import std.format : format;
auto got = compute(arg);
assert(got == expected, "expected %s got
%s".format(expected, got));
On Friday, 12 May 2017 at 09:02:25 UTC, Andrea Fontana wrote:
Another error: you want to invoke mixin with
testBoilerPlate!(...) not testBoilerPlate();
yes, forgot to add it ...
On Friday, 12 May 2017 at 08:47:32 UTC, visitor wrote:
works for me :
mixin template testBoilerPlate(alias arg, alias expected)
{
auto doit = {
import std.format : format;
auto got = compute(arg);
assert(got == expected, "expected %s got
%s".format(expected, got));
On Friday, 12 May 2017 at 00:20:13 UTC, سليمان السهمي (Soulaïman
Sahmi) wrote:
Is there a rational behind not allowing statements inside mixin
templates? I know mixin does accept code containing statements,
but using mixin is much uglier. so I was wondering.
example use case:
//--
Is there a rational behind not allowing statements inside mixin
templates? I know mixin does accept code containing statements,
but using mixin is much uglier. so I was wondering.
example use case:
//-
int compute(string)
{
return 1;
}
mixin template testBo