On Friday, 18 October 2024 at 12:07:24 UTC, Kadir Erdem Demir
wrote:
It seems [=] functionality C++ does not exist in D.
No, D does not have this functionality.
By using a helper function I made that example work.
```d
import std.stdio;
auto localFoo(int x) {
return (){ return x;};
}
On Friday, 18 October 2024 at 12:07:24 UTC, Kadir Erdem Demir
wrote:
It seems [=] functionality C++ does not exist in D.
By using a helper function I made that example work.
[...]
Because 'work' is captured, it is allocated on the heap.
The loops are all assigning values to this 'work' in the
this works for me
```
void aa()
{
void delegate()[] items;
auto captureFuction(int index)
{
return (){
auto localIndex = index;
writeln("index: ", localIndex);
};
}
for(int i =
On Friday, 18 October 2024 at 14:41:15 UTC, Mark Bauermeister
wrote:
...No more segfaults thus far but strangely the proper switch
case...
One thing that I can think looking at your code:
import std.stdio;
void main(){
int op = 1;
switch(op){
default: writeln("default"); retur
On Friday, 18 October 2024 at 14:41:15 UTC, Mark Bauermeister
wrote:
On Thursday, 17 October 2024 at 02:47:03 UTC, Mai Lapyst wrote:
[...]
Yea. I forgot about the sizeof division being wrong. I replaced
all calls to ARRAY_LEN with \.length.
[...]
Is the `switch` correct? I would expect to
On Thursday, 17 October 2024 at 02:47:03 UTC, Mai Lapyst wrote:
On Wednesday, 16 October 2024 at 13:10:34 UTC, Mark
Bauermeister wrote:
I think I got every compiler complaint fixed now. However,
upon launch the program immediately quits with "Error Program
exited with code -11". I assume that's
It seems [=] functionality C++ does not exist in D.
By using a helper function I made that example work.
```d
import std.stdio;
auto localFoo(int x) {
return (){ return x;};
}
void main() {
int x = 10;
auto lambda = (int capturedX = x) {
writeln("Captured reference : ", ca
On 13/10/2024 6:12 PM, Salih Dincer wrote:
On Saturday, 12 October 2024 at 13:11:52 UTC, Richard (Rikki) Andrew
Cattermole wrote:
You are not wrong, when it is a struct, it is being heap allocated.
Sorry for prolonging the topic. I am very curious about your answers
along with your patience..