On Monday, 10 May 2021 at 03:36:02 UTC, Виталий Фадеев wrote:
I have missformated post in thread:
https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org
Say, please,
how to remove own post from this forum ?
There's currently no way to remove or edit an existing post.
I have missformated post in thread:
https://forum.dlang.org/thread/kwpqyzwgczdpzgsvo...@forum.dlang.org
Say, please,
how to remove own post from this forum ?
This one runs fine,
```
import std.stdio;
void main()
{
static int Gfunction(int x){return x;}
int Lfunction(int x){return x;}
alias gfunction = int function(int);
alias lfunction = int delegate(int);
gfunction g = & G
On Monday, 10 May 2021 at 01:25:10 UTC, Alain De Vos wrote:
This does not:
```
import std.stdio;
void main()
{
int afunction(int x){return x;};
it's not static so -> context -> delegate
alias myint = int;
myint i=5;
I see.
Just like in Java.
I wonder why ?
The following program runs correctly
```
import std.stdio;
int afunction(int x){return x;};
void main()
{
alias myint = int;
myint i=5;
alias tfunction = int function(int);
tfunction f = & afunction;
writeln(f(1));
}
`
Hello,
I'm trying to setup a minimal testing process with unittest.
However, I would like to run the tests of a single file to keep
things fast.
At the moment, it runs all unittests that are imported with a
file.
eg.
`rdmd -I... source/foo.d` will run unittests bar.d if it is
imported into f
On Sunday, 9 May 2021 at 22:55:41 UTC, Imperatorn wrote:
Check the assembly
I already did, here's the "wrong" version when I only run `$ dmd
-betterC -m64 test.d`:
```
Dump of file test.obj
main:
pushrbp
mov rbp,rsp
mov rax,qword ptr gs:[58h]
mov rcx
On Sunday, 9 May 2021 at 21:42:54 UTC, Blatnik wrote:
On Sunday, 9 May 2021 at 20:56:01 UTC, Ali Çehreli wrote:
This is a long shot, but are you on OSX? I think TLS is
handled specially for 32-bit OSX and that may somehow work in
this case. (?)
Nope, I'm on (64bit) windows.
Another really we
On Sunday, 9 May 2021 at 20:56:01 UTC, Ali Çehreli wrote:
This is a long shot, but are you on OSX? I think TLS is handled
specially for 32-bit OSX and that may somehow work in this
case. (?)
Nope, I'm on (64bit) windows.
Another really weird thing is that if I compile this code in
VisualD (w
On 5/9/21 11:49 AM, Blatnik wrote:
Also, why did it work for 32-bits then?
This is a long shot, but are you on OSX? I think TLS is handled
specially for 32-bit OSX and that may somehow work in this case. (?)
Ali
On Sunday, 9 May 2021 at 17:53:07 UTC, SealabJaster wrote:
On Sunday, 9 May 2021 at 17:37:40 UTC, Andrey Zherikov wrote:
Is this a bug?
My best guess is that, since the struct doesn't have any member
functions the compiler has decided that the struct doesn't need
any access to the main funct
On Sunday, 9 May 2021 at 18:46:18 UTC, rikki cattermole wrote:
No.
It is tied to druntime. I.e. on Linux it calls __tls_get_addr
to get the address.
Oh. I wish I got a warning about that from the compiler then >.>
Also, why did it work for 32-bits then?
On 10/05/2021 6:41 AM, Blatnik wrote:
Do thread local variables work in -betterC? Or maybe it's better to ask
are they _supposed_ to work in -betterC?
No.
It is tied to druntime. I.e. on Linux it calls __tls_get_addr to get the
address.
Do thread local variables work in -betterC? Or maybe it's better
to ask are they _supposed_ to work in -betterC?
Here's a simple test program:
```D
// test.d
auto a;
extern(C) void main() {
printf("before... ");
a = 42;
printf("after");
}
import core.stdc.stdio;
```
And here is the out
On Sunday, 9 May 2021 at 18:41:33 UTC, Blatnik wrote:
Here's a simple test program:
Whoops, `auto a` should be `int a`. Habits :P
On Sunday, 9 May 2021 at 17:37:40 UTC, Andrey Zherikov wrote:
...
https://run.dlang.io/is/sCUdXe shows this a bit more clearly.
On Sunday, 9 May 2021 at 17:37:40 UTC, Andrey Zherikov wrote:
Is this a bug?
My best guess is that, since the struct doesn't have any member
functions the compiler has decided that the struct doesn't need
any access to the main function's context/frame pointer, so the
struct has implicitly b
On Sunday, 9 May 2021 at 17:37:40 UTC, Andrey Zherikov wrote:
Compilation of this code:
```d
auto foo(T)()
{
return T(); // Error: cannot access frame pointer of
`onlineapp.main.T`
}
void main()
{
struct T
{
int a=1;
void argsFunc(int a) {} // (1)
}
pragm
Compilation of this code:
```d
auto foo(T)()
{
return T(); // Error: cannot access frame pointer of
`onlineapp.main.T`
}
void main()
{
struct T
{
int a=1;
void argsFunc(int a) {} // (1)
}
pragma(msg,foo!T());
}
```
fails with this error:
```
onlineapp.d(3)
On Sunday, 9 May 2021 at 09:34:00 UTC, FreeSlave wrote:
You may try using tempCStringW from std.internal.cstring. It
uses small string optimization. However the api is internal, so
I'm not sure how valid it is to use this function. The returned
struct is a temporary buffer so you must ensure
On Sunday, 9 May 2021 at 10:53:49 UTC, tcak wrote:
The "dim" template parameter has a default value of 1 already.
Why does it still force me to give a value?
It doesn't, but it does require you to instantiate the template.
You can do `OpenClKernel!()` to use the default value.
But without th
public class OpenCLKernel(size_t dim = 1) if( (dim >= 1) && (dim
<= 3) )
{
public this( OpenCLProgram program, in string kernelName )
{
// ...
}
}
I have a class definition as above. When I want to create an
On Saturday, 8 May 2021 at 20:50:10 UTC, Vinod K Chandran wrote:
Hi all,
I am planning some win32 hobby projects. Now I have this
function to tackle the LPCWSTR data type in win32.
```d
private import std.utf;
auto toWString(S)(S s) { return toUTFz!(const(wchar)*)(s); }
```
Is there any better
25 matches
Mail list logo