On 12.07.21 03:37, someone wrote:
I ended up with the following (as usual advice/suggestions welcomed):
[...]> alias stringUTF16 = dstring; /// same as immutable(dchar)[];>
alias stringUTF32 = wstring; /// same as immutable(wchar)[];
Bug: You mixed up `wstring` and `dstring`. `wstring` is UTF-16
On Monday, 12 July 2021 at 05:08:29 UTC, jfondren wrote:
On Monday, 12 July 2021 at 04:25:00 UTC, Kirill wrote:
I know there is isArray!T and similar functionality in
std.traits. But I couldn't find the functionality that can
help me check if I have a multidimensional array. Is there
any? How
On Monday, 12 July 2021 at 04:25:00 UTC, Kirill wrote:
I know there is isArray!T and similar functionality in
std.traits. But I couldn't find the functionality that can help
me check if I have a multidimensional array. Is there any? How
do I create my own?
Thanks in advance.
from https://gi
I know there is isArray!T and similar functionality in
std.traits. But I couldn't find the functionality that can help
me check if I have a multidimensional array. Is there any? How do
I create my own?
Thanks in advance.
On Saturday, 10 July 2021 at 19:43:07 UTC, Danny Arends wrote:
On Saturday, 10 July 2021 at 12:41:19 UTC, Виталий Фадеев wrote:
[...]
Just disable shader compilation using dub, the shader only
needs to be compiled once. Since you're on linux it fails to
execute glslc.exe (the windows executa
On Sunday, 11 July 2021 at 05:54:48 UTC, Ali Çehreli wrote:
Ali
Primarily to Ali & Steve for their help, be advised, this post
will be somehow ... long.
Some bit of background to begin with: a week or so ago I posted
asking advice on code safeness, and still I didn't reply to the
ones tha
On Sunday, 11 July 2021 at 12:49:28 UTC, Adam D Ruppe wrote:
Indeed, you'd have to mixin the whole thing like
mixin("public struct " ~ lstrStructureId ~ " { ... } ");
As I mentioned in my previous reply to Ali this could be viable
for one-liners-or-so, but for chunks of code having, say, a
On Sunday, 11 July 2021 at 13:14:23 UTC, Steven Schveighoffer
wrote:
when I've done this kind of stuff, what I usually do is:
```d
struct Thing {
... // actual struct
}
mixin("alias ", lstrStructureID, " = Thing;");
```
the downside is that the actual struct name symbol will be
`Thing`, o
On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote:
Is there an example i can use Thank you.
You just call the registerMemoryHandler() function from that
module at some point in your main function before doing other
work.
On Sunday, 11 July 2021 at 21:15:30 UTC, Paul Backus wrote:
I know it's possible on Linux using the `etc.linux.memoryerror`
module [1]. Not sure about Windows.
Linux would be sufficient.
Is there an example i can use Thank you.
On Sunday, 11 July 2021 at 21:15:30 UTC, Paul Backus wrote:
I know it's possible on Linux using the `etc.linux.memoryerror`
module [1]. Not sure about Windows.
With -m32, it just works. With -m32mscoff I'm not sure. With
-m64, as far as I know, there is no way.
On Sunday, 11 July 2021 at 20:18:18 UTC, seany wrote:
Is it possible to catch a segfault - using try/catch loop?
Thank you
I know it's possible on Linux using the `etc.linux.memoryerror`
module [1]. Not sure about Windows.
[1] https://druntime.dpldocs.info/etc.linux.memoryerror.html
Is it possible to catch a segfault - using try/catch loop?
Thank you
On Sunday, 11 July 2021 at 14:04:14 UTC, zjh wrote:
just genenrate `lstrStructureID` struct.
```d
mixin template templateUGC ( typeStringUTF, alias
lstrStructureID){
public struct lstrStructureID {
typeStringUTF w;
}
}
mixin templateUGC!(string, "gudtUGC08");
```
You say `This creates a struct with teh literal name
lstrStructureID`.
I tried,can compile,but I don't know ge
On Sunday, 11 July 2021 at 13:30:27 UTC, zjh wrote:
Could you explain more detail?
It is just normal code with a normal name. The fact there's
another variable with the same name doesn't change anything.
On 7/9/21 5:13 PM, rempas wrote:
On Friday, 9 July 2021 at 20:54:21 UTC, Paul Backus wrote:
On Friday, 9 July 2021 at 20:43:48 UTC, rempas wrote:
I'm reading the library reference for
[core.time](https://dlang.org/phobos/core_time.html#Duration) and It
says that the duration is taken in "hnsec
On Sunday, 11 July 2021 at 13:21:35 UTC, DLearner wrote:
Is there a 'D' way of avoiding the issue?
Pass the size as a parameter to the thing instead of trying to
combine things. like
mixin template Thing(size_t size) {
ubyte[size] pool;
}
and where you want it like
mixin Thing!(100);
On Sunday, 11 July 2021 at 12:49:28 UTC, Adam D Ruppe wrote:
This creates a struct with teh literal name `lstrStructureID`.
Just like any other name. So it is NOT the value of the
variable.
Could you explain more detail?
On Sunday, 11 July 2021 at 12:47:48 UTC, Adam D Ruppe wrote:
On Sunday, 11 July 2021 at 12:37:20 UTC, DLearner wrote:
C:\Users\SoftDev\Documents\BDM\D\Examples\CTFE\T2>type k_mod.d
// k_mod.d
ubyte[MemSiz] MemPool;
You didn't import the other module here.
D's imports aren't like C's inclu
On 7/11/21 8:49 AM, Adam D Ruppe wrote:
On Sunday, 11 July 2021 at 05:20:49 UTC, someone wrote:
```d
mixin template templateUGC (
typeStringUTF,
alias lstrStructureID
) {
public struct lstrStructureID {
typeStringUTF whatever;
}
This creates a struct with teh literal n
On 7/10/21 12:32 PM, Mathias LANG wrote:
On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote:
On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote:
I think it's the throwing/catching of the `Throwable` that is
allocating. But I don't know from where the allocation happens
On Sunday, 11 July 2021 at 05:20:49 UTC, someone wrote:
```d
mixin template templateUGC (
typeStringUTF,
alias lstrStructureID
) {
public struct lstrStructureID {
typeStringUTF whatever;
}
This creates a struct with teh literal name `lstrStructureID`.
Just like any oth
On Sunday, 11 July 2021 at 12:37:20 UTC, DLearner wrote:
C:\Users\SoftDev\Documents\BDM\D\Examples\CTFE\T2>type k_mod.d
// k_mod.d
ubyte[MemSiz] MemPool;
You didn't import the other module here.
D's imports aren't like C's includes. Each module is independent
and can only see what it itse
On Sunday, 11 July 2021 at 12:01:27 UTC, jfondren wrote:
On Sunday, 11 July 2021 at 10:58:58 UTC, DLearner wrote:
Is there a way of forcing DMD to extend the scope of `MemSiz`
to include `k_mod`?
Best regards
```
$ cat k_mod.d
import test01;
ubyte[MemSiz] MemPool;
$ cat test01.d
enum MemSi
On Sunday, 11 July 2021 at 10:58:58 UTC, DLearner wrote:
Is there a way of forcing DMD to extend the scope of `MemSiz`
to include `k_mod`?
Best regards
```
$ cat k_mod.d
import test01;
ubyte[MemSiz] MemPool;
$ cat test01.d
enum MemSiz = 240;
void main() {
import std.stdio, k_mod;
w
Please see the two code snippets below:
```
// test01.d
enum MemSiz = 240;
void main() {
import k_mod;
}
```
and
```
// k_mod.d
ubyte[MemSiz] MemPool;
```
A number of tests need to be run on code in `k_mod`,
with different sizes of the static array `MemPool` in each test.
So each test
On Sunday, 11 July 2021 at 09:20:23 UTC, JG wrote:
I am getting the following message:
Warning: struct SumType has method toHash, however it cannot be
called with const(SumType!(A,B,C)) this
Could someone point in the right direction to understand what I
am doing that causes this?
The two r
I am getting the following message:
Warning: struct SumType has method toHash, however it cannot be
called with const(SumType!(A,B,C)) this
Could someone point in the right direction to understand what I
am doing that causes this?
29 matches
Mail list logo