On Friday, 14 April 2023 at 03:50:37 UTC, backtrack wrote:
Dear All, I am new to D lang. I have been given a task to
consume the .dll generated from a D lang project.
I added extern (c) function for call the .dll from CPP file. i
have code like below
```
// myfile.d
extern(c)
{
mystruc
Dear All, I am new to D lang. I have been given a task to consume
the .dll generated from a D lang project.
I added extern (c) function for call the .dll from CPP file. i
have code like below
```
// myfile.d
extern(c)
{
mystruct* getmystruct()
{
mystruct* mystruct =
cast(m
On Friday, 14 April 2023 at 00:28:53 UTC, Ki Rill wrote:
```
LINK : fatal error LNK1104: cannot open file 'libucrt.lib'
Error: linker exited with status 1104
```
Why does it require this library and where can I find it?
Since this library is a component of the Microsoft C Runtime
(CRT) librar
On Thursday, 13 April 2023 at 22:09:48 UTC, Jacob Shtokolov wrote:
[...]
ref opIndex(string key) return
[...]
Regarding the return ref I found this code of 2019 on my harddisk
which is from or was motivated by a dconf talk:
```
ref int foo (ref int i)
{
return i;
}
ref int bar ()
{
On Wednesday, 12 April 2023 at 10:05:14 UTC, Salih Dincer wrote:
On Tuesday, 11 April 2023 at 10:24:09 UTC, Ki Rill wrote:
If you wanted static I would add and run libraries easy, like
this:
```Json
"libs": [
"csfml-audio",
"csfml-graphics"
],
On Thursday, 13 April 2023 at 07:05:10 UTC, Chris Katko wrote:
I'm trying to figure out how to return a reference to something
that may not be a reference type.
```d
@safe:
struct Stats
{
float[string] data;
ref opIndex(string key) return
{
// The `require()` takes care of
On Thursday, 13 April 2023 at 07:05:10 UTC, Chris Katko wrote:
Right now, I'm using pointers which resolves to:
```D
// float* opIndex(string key){...} using pointer
(*s["tacos"])++; // works with pointer, but is strange looking
s["tacos"]++; // preferred syntax or something similar
```
You c
On Thursday, 13 April 2023 at 07:05:10 UTC, Chris Katko wrote:
I'm trying to figure out how to return a reference to something
that may not be a reference type.
```D
struct stats
{
float[string] data=0;
float ref opIndex(string key)
{
return data[key]; // want a ref to a specific element
On Wednesday, 12 April 2023 at 21:00:04 UTC, John Chapman wrote:
You can also express it like this:
```d
extern(C) alias FuncPtr = void* function(void*);
```
Thank you! This is how I was planning to do anyway because other
that the fact that I like the syntax of that a little bit more,
this
On Wednesday, 12 April 2023 at 20:36:59 UTC, H. S. Teoh wrote:
IMO this is a bug either in D's syntax or in the parser. I'd
file an enhancement request.
In the meantime, you can use alias as a workaround:
---snip---
extern(C) void* abc(void*) {return null;}
alias FuncPtr = typeof(
I'm trying to figure out how to return a reference to something
that may not be a reference type.
```D
struct stats
{
float[string] data=0;
float ref opIndex(string key)
{
return data[key]; // want a ref to a specific element
}
}
void test()
{
stats foo;
auto x = foo.bar(); // returns so
11 matches
Mail list logo