Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you can't take the address of a template without instantiating it first. To make your example work, replace `&addToBiz` with `&add

Re: Translating C precompiler macros to D

2023-11-09 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 20:43:21 UTC, solidstate1991 wrote: Here's this precompiler macro from Pipewire, on which many important inline functions depend on, like this one: ```c /** * Invoke method named \a method in the \a callbacks. * The \a method_type defines the type of the metho

Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Thursday, 9 November 2023 at 09:40:47 UTC, Bienlein wrote: On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you can't take the address of a template without instantiating it fi

Re: DMD: How to compile executable without producing .obj file?

2023-11-09 Thread Kagamin via Digitalmars-d-learn
The .exe is produced by the linker, which works with files: it takes one or more .obj files with program code and links them into and .exe file. I heard ldc has builtin linker or something like that, so hypothetically might be able to link on the fly.

Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Thursday, 9 November 2023 at 10:14:46 UTC, Bienlein wrote: On Thursday, 9 November 2023 at 09:40:47 UTC, Bienlein wrote: On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you ca

Re: D: How would one make a shared dynamically linked D library?

2023-11-09 Thread IchorDev via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 11:48:58 UTC, BoQsc wrote: I would like to export some functionality as external shared dynamically linked D library. Is it possible to do that in D Language Yes, as long as the symbols you want to use externally are `public`, which is the default. When it co

Re: DMD: How to compile executable without producing .obj file?

2023-11-09 Thread Inkrementator via Digitalmars-d-learn
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 cr