https://github.com/webfreak001/ctfe-data
Allows you to put arbitrary data into the executable at CTFE, for later retrieval using a runtime process, e.g. saving meta-data and retreiving it later.
https://github.com/webfreak001/ctfe-data
Last synced: 5 months ago
JSON representation
Allows you to put arbitrary data into the executable at CTFE, for later retrieval using a runtime process, e.g. saving meta-data and retreiving it later.
- Host: GitHub
- URL: https://github.com/webfreak001/ctfe-data
- Owner: WebFreak001
- Created: 2023-08-31T15:41:34.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-12-30T18:05:41.000Z (7 months ago)
- Last Synced: 2026-01-03T14:49:20.566Z (7 months ago)
- Language: D
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ctfe-data
Allows you to put arbitrary data into the executable at CTFE, for later retrieval
using a runtime process, e.g. saving meta-data and retreiving it later.
Limitations: currently only supported on LDC on linux. GDC on linux needs `align(16)` on the passed in data.
## Example
```d
// app code
injectCTFE!(ExamplePerson("Person inside main", 2));
```
```d
// reader code
foreach (row; extractCTFEData!ExamplePerson("./app1"))
writeln("row: ", row);
```
```
cd example
dub build --compiler=ldc2 --config=application
dub run --compiler=ldc2 --config=reader
```