Skip to content

Instantly share code, notes, and snippets.

@erkrali
erkrali / interpolation.d
Created October 30, 2023 18:02
mixin-based string interpolation in D with implicit conversion to string
module interpolation;
import std.meta;
public:
private struct InterpolatedBlockTag { }
auto interpolatedBlock(string _preText, string _format, string _originalSymbol, T)(auto ref T val) {
static struct InterpolatedBlock {
public: