Ideas anyone?
I cracked it:
auto opBinary(string op, U,
string file = __FILE__,
int line = __LINE__)(U rhs)
{
static if (is(U == Bound))
{
alias C = CommonType!(T, U.type);
Bound!(C,
cast(C)m
I'm trying to extend my wrapper class Bound to support CTFE Value
Range Propagation in primary in opUnary and opBinary similar to
what Ada's Range Types.
My current try so far for binary arithmetic is
auto opBinary(string op, U,
U lower_rhs = U.min,
U up
On 03/19/2014 05:34 PM, Adam D. Ruppe wrote:
On Wednesday, 19 March 2014 at 16:10:52 UTC, Dicebot wrote:
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
megarox. Make it so.
Nice. I have some ugly hacks that's probably full of bugs for this (look
at the botto
On 3/19/14, Adam D. Ruppe wrote:
> Is there anything we can do with static if to identify it as a
> template?
https://github.com/D-Programming-Language/dmd/pull/3380
> And after we determine it is a template, can we extract the
> required arguments list like we can with a regular function at
> a
Given:
template Foo(string T) { enum Foo = to!int(T); }
(or anything else, really)
Is there anything we can do with static if to identify it as a
template?
I tried:
static if(is(Foo == template)) {} // nope, basic type expected,
not template
Note that is(typeof(Foo) == function) {} is ho
On Wednesday, 19 March 2014 at 16:10:52 UTC, Dicebot wrote:
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
megarox. Make it so.
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
As a workaround one can use set of relevant trait checks:
1) type is void
2) is not a variable or callable
3) .stringof fits "NAME(ARGS)" pattern
On Wednesday, 19 March 2014 at 16:18:17 UTC, Andrej Mitrovic
wrote:
And after we determine it is a template, can we extract the
required arguments list like we can with a regular function at
all?
Well there's TemplateArgsOf for *instantiations*, but I'm not
sure how
one would do it with non-in
On Wednesday, 19 March 2014 at 10:10:18 UTC, Vladimir Panteleev
wrote:
If you use rdmd, it will be printed twice, because rdmd invokes
dmd once to gather the program's dependencies, and a second
time to actually build the program.
Yes i'm using rdmd. Thanks.
Disregard my comment, Vladimir is right :)
On Wednesday, 19 March 2014 at 10:08:50 UTC, Gary Willoughby
wrote:
Why does the following program write the message 'Foo' twice?
void main(string[] args)
{
pragma(msg, "Foo");
}
Once upon compilation and once upon run-time. I don't know if it
is intended design but this is how `pragma
On Wednesday, 19 March 2014 at 10:08:50 UTC, Gary Willoughby
wrote:
Why does the following program write the message 'Foo' twice?
void main(string[] args)
{
pragma(msg, "Foo");
}
The message is not printed by the program, but by the compiler.
If you build the program via dmd, the mess
Why does the following program write the message 'Foo' twice?
void main(string[] args)
{
pragma(msg, "Foo");
}
14 matches
Mail list logo