Consider this almost minimal example:
```
import std.algorithm;
import std.range;
import std.stdio;
struct S(Nested){
Nested member; // = I.init; // Uncommenting this wouldn't help
int g;
this(Nested member){
this.member = member;
}
On Sunday, 22 October 2023 at 21:02:32 UTC, Inkrementator wrote:
Running the code with `rdmd -version=fix app.d` works, but
running `rdmd -version=fix app.d` produces:
`Error: field `member` must be initialized in constructor,
because it is nested struct`
Sorry, obviously it should be:
On Sunday, 22 October 2023 at 23:49:40 UTC, Paul Backus wrote:
Nested structs contain a context pointer that needs to be
initialized at runtime. If you don't initialize them, the
pointer gets set to `null`, and the struct will not be able to
access its context.
I see, thanks for the
On Sunday, 5 November 2023 at 18:58:48 UTC, BoQsc wrote:
When you compile using `dmd` compiler you will often get `.exe`
and `.obj` file.
I would like to only produce `.exe` file:
On linux, gdc automatically cleans up object files by default.
Passing it the -pipe option will prevent their
On Friday, 24 March 2023 at 23:45:15 UTC, eXodiquas wrote:
Hello everyone,
once again, I am here for your help. My last questions were
answered really competently so I try again. :P
So, maybe this is a stupid question, but I have read a lot
about Bindings to C and C++ libraries for D. For
On Sunday, 26 March 2023 at 18:49:57 UTC, eXodiquas wrote:
On Sunday, 26 March 2023 at 14:09:19 UTC, Inkrementator wrote:
But you said static bindings are the main portion of bindings
we use. So I tried to get static Lua bindings going.
Static Binding != Static Linking. Like I said, the
On Monday, 27 March 2023 at 00:45:28 UTC, Salih Dincer wrote:
Likes **17**
Views **265**
Released on March **8, 2023**
I'm surprised that you can get 300 views in a month on a
primarily D video, but it's nice to see
On Sunday, 7 May 2023 at 21:12:22 UTC, Chris Piker wrote:
On the other hand, your first suggestion of using opCast() does
seem like a reasonable choice to me. Can you provide a short
code snippet using opCast to achieve the same result?
I've never used it, and particularly I know that I
On Sunday, 7 May 2023 at 18:19:04 UTC, Ali Çehreli wrote:
alias this is for implicit type conversions, which can be
achieved explicitly as well.
Open question to everybody: What you're opinion on using opCast
for this? Since it's a type conversion, it seems fitting to me.
And another
On Thursday, 25 January 2024 at 18:44:26 UTC, atzensepp wrote:
However this works:
```d
int delegate (int) td = (x) =>
compose!(f,g,g,f,g,g,f,g,g,f)(x);
```
While not a real function pointer, this might already fit your
needs.
```d
alias td = compose!(f,g);
```
On Monday, 11 March 2024 at 16:10:24 UTC, Andrea wrote:
just trying it out and kinda fits my needs; the main issues are
lack of documentation and the need to explicit loop on array
data structures in the code (using sub-contexts) instead of
having a "foreach" loop statement in the template
Hello,
I am trying to derive a struct from another. I want to modify
each field such that type of it goes from some T to Nullable!T,
preserving all fieldnames and UDAs.
I think that fieldnames and UDAs can only be duplicated via
string-mixins. This means that all field-types that aren't
On Friday, 15 March 2024 at 17:48:26 UTC, mw wrote:
```
$ dub build
Could not resolve configuration for package demo
```
Trying to build your dependency msgpack-rpc, it spits out
```
Warning The sub configuration directive "vibe-d" ->
[libevent] references a configuration that does not
On Saturday, 16 March 2024 at 13:09:13 UTC, Adam D Ruppe wrote:
On Thursday, 14 March 2024 at 23:19:37 UTC, Inkrementator wrote:
@(__traits(getAttributes, thingYouWantToForward))
void yourNewThing() {}
Thanks, that should solve my problem.
On Friday, 15 March 2024 at 19:13:38 UTC, cc wrote:
This is trivially easy if your types are visible at module
level, and mixin is a fine tool for the job. It doesn't work
quite so well with [Voldemort
types](https://wiki.dlang.org/Voldemort_types).
I used the following lines to make it work
15 matches
Mail list logo