On Friday, 23 August 2024 at 08:58:16 UTC, Me'vâ wrote:
writeln("Result: ", i + ++i);
I would definitely expect 11 as result (but I still have K&R on
my book shelf, maybe I'm a bit biased). So, when you get 12 with
C, I would consider that an error.
Thanks, understood. But isn't this a deficiency in the library
that should be fixed?
Hi all,
I have a problem with Tuples and struct templates that contain an
alias this:
```d
import std;
struct Element(T)
{
T payload;
alias payload this;
this (T p)
{
payload = p;
}
}
class Item {}
void main ()
{
auto e = Eleme
On Wednesday, 25 August 2021 at 12:23:06 UTC, Adam D Ruppe wrote:
...
Thanks - that explains in all.
On Wednesday, 25 August 2021 at 12:23:32 UTC, FeepingCreature
wrote:
class Alias_Class
{
Test_Struct ts;
Test_Struct getter() { return ts; }
alias getter this;
}
Good idea, that
Hi all,
I have a little problem understanding alias this. I always
thought, that alias this only makes implicit conversions from the
aliased object to this. Then, why do lines 18 and 22 compile in
the code below? And, btw, line 22 crashes with a segmentation
fault.
```d
01 struct Test_Struc
On Monday, 26 April 2021 at 10:42:54 UTC, Mike Parker wrote:
(According to -v: DMD64 D Compiler v2.096.0-dirty)
That's actually normal for the Windows versions. I'm not sure
where it comes from, but it's always there.
Ouuu, that's bad advertising, isn't it? Who wants to use dirty
software, it
On Monday, 26 April 2021 at 08:58:25 UTC, Raimondo Mancino wrote:
According to -v: DMD64 D Compiler v2.096.0-dirty
Well, that says it all, doesn't it? I'm not familiar with the
windows versions, but that doesn't seem to be an offical release
- at least I never had a dmd2 that claimed to be di
You could tell your thread via a shared variable that main has
ended:
import std.stdio;
import std.concurrency;
import core.thread;
shared bool end = false;
void thread ()
{
for (;;)
{
Thread.sleep (500.msecs);
synchronized
{
On Sunday, 6 September 2020 at 11:10:14 UTC, Simen Kjærås wrote:
auto e = receiveOnly!(shared(Env)*);
Oh, thanks. Seems, that I just missed that bit with the
pranetheses.
Hi,
I have a struct in a separate thread and want to pass it's
address back to the main thread. This is how I think it should
work:
import std.concurrency;
struct Env {}
void run ()
{
shared Env env;
ownerTid.send (&env);
for (;;) {}
}
void main ()
{
spawn (
I'm doing this in an X11 application in order to send a timer
event every 100 milliseconds to the main event queue.
class Application
{
shared private bool s_tick;
void clock_task (shared X11.Display* disp, X11.Atom atom,
X11.Window win)
{
for (;;)
{
try
{
re
On Tuesday, 4 February 2020 at 10:17:39 UTC, Dennis wrote:
C++ has a const system that is closer to D's than any other
language, but it still has huge differences:
Thanks, that clears it up a bit!
Hi,
I'm just wondering about defining const pointers and if there's a
difference in C and D.
in C, this works:
const char* text = "Hello";
text = "world";
but in D it doesn't, because the char* is const. Ff I would like
tho have the same behaviour in D as in C, I need to write:
const (cha
On Saturday, 9 March 2019 at 18:11:09 UTC, Jacob Shtokolov wrote:
I tried to use std.conv.to and std.conv.parse, but found that
they can't really do this. When I call `data.to!int`, the value
of "123.45" will be converted to int!
Are you sure? This here works for me:
import std.stdio;
import
Agreed, but I assumed, that since all definitions in cairo.d are
defined as
extern (System), (same happens with extern (C), btw.), I would
have expected,
that D does not implicitly generate initialisation functions.
So, why is there no init routine for the rectangle? There's only
one for the m
Hi,
I'm fiddling around with cairo (downloaded
fromhttps://github.com/D-Programming-Deimos/cairo) and I stumbled
over this problem:
(file rectandmatrix.d)
import deimos.cairo.cairo;
void main ()
{
cairo_rectangle_int_t rect;
cairo_matrix_t matrix;
}
Compiling that with 'dm
16 matches
Mail list logo