BindTemplate

Binds template arguments.

  • use args[i] or arg!i to refer i-th argument;
  • use args[$ - i] to refer arguments from the end (also args[$ + i] can be used for negative i);
  • use args[a .. b] or argsRange!(a, b) to refer arguments from a-th up to and excluding b-th;
  • use argsToEnd!n to refer arguments from n-th argument up to the end;
  • use allArgs to refer all arguments.

Members

Aliases

BindTemplate
alias BindTemplate(Args...) = Template!(TemplateBindArgs!(BindArgs.length, BindArgs, Args))
Undocumented in source.

Bugs

Currently there is no support for args[a .. $] because of compiler limitations.

Examples

import unstd.traits;

static assert(is(Inst!(BindTemplate!(CommonType, long, allArgs), int) == long));
static assert(!Inst!(BindTemplate!(isImplicitlyConvertible, args[0], int), long));
static assert( Inst!(BindTemplate!(isImplicitlyConvertible, int  , arg!0), long));

alias UnqualAll = BindTemplate!(MapTuple, Unqual, allArgs);
static assert(is(UnqualAll!(const(int), immutable(bool[])) == TypeTuple!(int, immutable(bool)[])));

Meta