stringofParams

Produces a string of the unqualified parameters of the passed function alias.

template stringofParams (
alias fun
) {
enum stringofParams;
}

Members

Imports

Parameters (from std.traits)
public import std.traits : Parameters, Unqual, staticMap;
Undocumented in source.
Unqual (from std.traits)
public import std.traits : Parameters, Unqual, staticMap;
Undocumented in source.
staticMap (from std.traits)
public import std.traits : Parameters, Unqual, staticMap;
Undocumented in source.

Parameters

fun

A function alias to get the parameter string of.

Examples

void foo(bool b, int i, string s) {}
static assert(stringofParams!foo == "bool, int, string");
void foo();
void foo1(string);
void foo2(string, int);
void foo3(bool, bool, bool);

enum ofFoo = stringofParams!foo;
enum ofFoo1 = stringofParams!foo1;
enum ofFoo2 = stringofParams!foo2;
enum ofFoo3 = stringofParams!foo3;

static assert(!ofFoo.length, ofFoo);
static assert((ofFoo1 == "string"), ofFoo1);
static assert((ofFoo2 == "string, int"), ofFoo2);
static assert((ofFoo3 == "bool, bool, bool"), ofFoo3);