July 30, 2021 Learn » translate C struct char array into D | |||
|---|---|---|---|
| |||
...prev;
struct test1 *next;
size_t v1;
size_t v2;
size_t v3;
char data... | |||
July 30, 2021 General » Re: Casting ulong to int with @nogc | |||
|---|---|---|---|
| |||
...be portable without any conversion:
```d
@nogc size_t
myFunction(size_t number) {
return number;
}
```
| |||
July 29, 2021 General » Re: @system blocks and safer @trusted (ST) functions | |||
|---|---|---|---|
| |||
...bytes extern(C) void writeIntoCBuffer (int* ptr, size_t len) @system; void writeIntoDBuffer (ref int... | |||
July 28, 2021 Issues » [Issue 22155] New: practical range usage often causes unnecessary closure allocations. | |||
|---|---|---|---|
| |||
...b) @nogc {
import std.algorithm.iteration : map;
size_t i = 0;
foreach (el; a.map... | |||
July 28, 2021 Issues » [Issue 22153] New: Non-void arrays do not match`inout void[]` arguments in implicit function template instantiation (IFTI) | |||
|---|---|---|---|
| |||
...com
Example:
---
size_t bytesUsed1()(const void[] array) { return array.length; }
size_t bytesUsed2()(inout... | |||
July 26, 2021 General » Re: @system blocks and safer @trusted (ST) functions | |||
|---|---|---|---|
| |||
...C) int read(int fd, void *ptr, size_t nBytes); ``` Without reading the code of... | |||
July 26, 2021 General » Re: @system blocks and safer @trusted (ST) functions | |||
|---|---|---|---|
| |||
...black box: ```d /// Returns: a valid size_t size_t favoriteNumber() @safe; int favoriteElement(ref... | |||
July 26, 2021 General » Re: @system blocks and safer @trusted (ST) functions | |||
|---|---|---|---|
| |||
...change the return type of favoriteNumber to size_t and let it return 300. Badaboom... | |||
July 25, 2021 General » Re: @system blocks and safer @trusted (ST) functions | |||
|---|---|---|---|
| |||
...syntax from your proposal:
```d
module example;
size_t favoriteNumber() @safe { return 42; }
int favoriteElement... | |||
July 25, 2021 Learn » Re: Destructors can't be @nogc? | |||
|---|---|---|---|
| |||
...void
main() {
//auto size = __traits(classInstanceSize, TestClass);
//auto memory = malloc(size)[0..size];
scope /*notice... | |||
Copyright © 1999-2021 by the D Language Foundation