On Wednesday, 10 March 2021 at 04:57:19 UTC, Paul Backus wrote:
On Wednesday, 10 March 2021 at 03:39:15 UTC, Meta wrote:
class Human {
static immutable MAX_AGE = 122;
bool alive = true;
int age = 0;
//Error: mutable method onlineapp.Human.checkAge is not
callable using a const
On Wednesday, 10 March 2021 at 03:39:15 UTC, Meta wrote:
class Human {
static immutable MAX_AGE = 122;
bool alive = true;
int age = 0;
//Error: mutable method onlineapp.Human.checkAge is not
callable using a const object
invariant(checkAge());
[...]
What the hell does th
class Human {
static immutable MAX_AGE = 122;
bool alive = true;
int age = 0;
//Error: mutable method onlineapp.Human.checkAge is not
callable using a const object
invariant(checkAge());
void growOlder()
in(alive)
out(; checkAge())
{
age++;
i
On Tuesday, 9 March 2021 at 18:53:06 UTC, Boris Carvajal wrote:
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote:
On Tuesday, 9 March 2021 at 02:57:46 UTC, Adam D. Ruppe wrote:
try
is(typeof(f) == function)
it is kinda weird but that's the trick
Thanks!
Should it work for in
On Tuesday, 9 March 2021 at 20:23:48 UTC, z wrote:
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote:
...
Then it seems the only way to get AVX-compatible inline
assembly(ldc.llvmasm excluded) is to use an external assembler.
For example :
...
But i'm not really sure how to integrate that i
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote:
...
Then it seems the only way to get AVX-compatible inline
assembly(ldc.llvmasm excluded) is to use an external assembler.
For example :
import std.stdio;
extern(C) void vxorps_d(ubyte[32]*);
void main() {
ubyte[32] a = 2;
So, I can't seem to get unary operators to work with variants.
For example:
Variant x = 10;
writeln(-x); // Error: x is not of arithmetic type, it is a
VariantN!32LU
Obviously binary operators like + work fine. Is there a reason
opUnary wasn't implemented as well? Is there a work-around for
On Tuesday, 9 March 2021 at 15:44:39 UTC, MoonlightSentinel wrote:
On Saturday, 6 March 2021 at 08:15:16 UTC, Imperatorn wrote:
Are you sure? 🤔
I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta
and none of them worked.
Yes. All of those were stuck at 2.093 due to some issues with
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote:
On Tuesday, 9 March 2021 at 02:57:46 UTC, Adam D. Ruppe wrote:
try
is(typeof(f) == function)
it is kinda weird but that's the trick
Thanks!
Should it work for in this case as well?
alias f = (){};
writeln(typeof(f).stringof);
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote:
On Tuesday, 9 March 2021 at 02:57:46 UTC, Adam D. Ruppe wrote:
try
is(typeof(f) == function)
it is kinda weird but that's the trick
Thanks!
Should it work for in this case as well?
alias f = (){};
writeln(typeof(f).stringof);
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote:
Should it work for in this case as well?
alias f = (){};
I actually don't know. The docs do say that function pointers
work differently - they match `is(typeof(f) == return)` but it
isn't clear if it would match == function.
On Tuesday, 9 March 2021 at 14:22:44 UTC, Andrey Zherikov wrote:
In case of function template this is possible but the original
question was about lambdas. There is no way that lambda can
change number of parameters during instantiation, am I right?
Yes, you're correct. The issue is that the c
On Saturday, 6 March 2021 at 09:38:54 UTC, Ali Çehreli wrote:
Are you getting the same errors with those dmd versions?
My locally installed compiler is dmd 2.094.2, which seems to be
too old for parse's new doCount template parameter. (I look
inside /usr/include/dmd/phobos/std/conv.d on my Lin
On Saturday, 6 March 2021 at 08:15:16 UTC, Imperatorn wrote:
Are you sure? 🤔
I tried switching to dmd-beta, dmd-nightly, ldc and ldc-beta
and none of them worked.
Yes. All of those were stuck at 2.093 due to some issues with
Travis. We've resolved those issues over the last few days and
au
On Tuesday, 9 March 2021 at 03:08:14 UTC, Paul Backus wrote:
If you know the arguments you want to call the function with,
the easiest way to check if you can do it is with
__traits(compiles):
static if (__traits(compiles, f(1)))
f(1);
else static if (__traits(compiles, f(1, 2)))
f(2);
On Tuesday, 9 March 2021 at 02:57:46 UTC, Adam D. Ruppe wrote:
try
is(typeof(f) == function)
it is kinda weird but that's the trick
Thanks!
Should it work for in this case as well?
alias f = (){};
writeln(typeof(f).stringof);// prints "void function()
pure nothrow @nogc @safe"
wr
16 matches
Mail list logo