On 15/04/2024 10:36 AM, Liam McGillivray wrote:
Well, it did work when I tried it (using a string variable, not a
literal of course). It displayed as it is supposed to. But from the
information I can find on the web it looks like strings are sometimes
but not |always| zero-terminated. Not a
On Sunday, 14 April 2024 at 22:36:18 UTC, Liam McGillivray wrote:
On Friday, 12 April 2024 at 15:24:38 UTC, Steven Schveighoffer
wrote:
```d
void InitWindow(int width, int height, ref string title) {
InitWindow(width, height, cast(const(char)*)title);
}
```
This is invalid, a string may
On Friday, 12 April 2024 at 15:24:38 UTC, Steven Schveighoffer
wrote:
```d
void InitWindow(int width, int height, ref string title) {
InitWindow(width, height, cast(const(char)*)title);
}
```
This is invalid, a string may not be zero-terminated. You can't
just cast.
Well, it did work
On Friday, 12 April 2024 at 00:04:48 UTC, Liam McGillivray wrote:
Here's what I wanted to do.
In the library I'm working on, there are various declarations
for functions defined in an external C library following the
line `extern (C) @nogc nothrow:`. Here are some examples of
such
On Tuesday, 9 April 2024 at 12:45:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
On 09/04/2024 12:48 PM, Liam McGillivray wrote:
I suppose this was a good new thing to learn, though I'm still
quite far from being able to construct a function from another
function using a template.
I
On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew
Cattermole wrote:
On 10/04/2024 11:21 AM, Liam McGillivray wrote:
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the
compiler.
So that
On 10/04/2024 2:50 PM, Liam McGillivray wrote:
On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew
Cattermole wrote:
The string mixin triggers CTFE, if ``EnumPrefixes`` wasn't templated,
that would cause codegen and hence error. If you called it in a
context that wasn't CTFE only,
On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew
Cattermole wrote:
The string mixin triggers CTFE, if ``EnumPrefixes`` wasn't
templated, that would cause codegen and hence error. If you
called it in a context that wasn't CTFE only, it would codegen
even with template and would
On 10/04/2024 11:21 AM, Liam McGillivray wrote:
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the compiler.
So that function is being used for both, and hence uses GC (appending).
Are you sure that
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the
compiler.
So that function is being used for both, and hence uses GC
(appending).
Are you sure that string appending was really the problem that
On 09/04/2024 12:48 PM, Liam McGillivray wrote:
On Tuesday, 9 April 2024 at 00:02:02 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
enum Value = (a, b) {
return a + b;
}(1, 2);
```
This alone should be a CTFE only function.
But if we want template parameters, we'd need to wrap it
On Sunday, 7 April 2024 at 06:46:39 UTC, Liam McGillivray wrote:
instantiated from here: `front!char`
Looks like autodecoding, try to comment `canFind`.
On Tuesday, 9 April 2024 at 00:02:02 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
enum Value = (a, b) {
return a + b;
}(1, 2);
```
This alone should be a CTFE only function.
But if we want template parameters, we'd need to wrap it with
the template.
```d
template Value(int a,
On 09/04/2024 11:42 AM, Liam McGillivray wrote:
On Monday, 8 April 2024 at 08:12:22 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
template Foo(Args) {
enum Foo = () {
return Args.init;
}();
}
```
Something like that should work instead.
I'm sorry, but I can't
On Monday, 8 April 2024 at 08:12:22 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
template Foo(Args) {
enum Foo = () {
return Args.init;
}();
}
```
Something like that should work instead.
I'm sorry, but I can't comprehend any of your example. What
would be fed into
On 08/04/2024 10:45 AM, Liam McGillivray wrote:
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the compiler.
:-(
Will this ever be changed?
A tad unlikely, it would be a rather large change
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the
compiler.
:-(
Will this ever be changed?
```d
template Foo(Args) {
enum Foo = () {
return Args.init;
}();
}
```
Unfortunately runtime and CTFE are the same target in the compiler.
So that function is being used for both, and hence uses GC (appending).
```d
template Foo(Args) {
enum Foo = () {
return Args.init;
}();
}
```
Something like that should work instead.
18 matches
Mail list logo