-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Well, not exactly template-less usage, but for usage with a non-template function.
e.g.:
struct IHead { // name TBD
string[] interpolated; // optional, maybe we don't even need this?
}
struct InterpolationHeader(_parts...) {
alias parts = _parts;
string toString() { return null; }
IHead __noTemplate()() {
static immutable parts = [_parts];
return IHead(parts);
}
alias __noTemplate this;
}Now, one can write a function that takes an interpolation header without using templates:
void foo(IHead header, ...) {
...
}You still get the information from the header, you still get the strings as passed, but don't have to define it using a template parameter. It also might clean up some templated usage:
void foo(T...)(IHead header, T params) {
...
}This is for code which might not have a need to use the header at compile-time.
Metadata
Metadata
Assignees
Labels
No labels