The OpenD Programming Language

aliasCall

Replaces call operator (opCall) for the value using its method. The funciton is designed to use with $(NDSLICE, topology, vmap) or $(NDSLICE, topology, map).

  1. AliasCall!(T, methodName, TemplateArgs) aliasCall(T value)
    template aliasCall(string methodName, TemplateArgs...)
    @property
    AliasCall!(T, methodName, TemplateArgs)
    aliasCall
    (
    T
    )
    ()
  2. AliasCall!(T, methodName, TemplateArgs) aliasCall(T value)

Members

Functions

aliasCall
AliasCall!(T, methodName, TemplateArgs) aliasCall(T value)

Parameters

methodName

name of the methods to use for opCall and opIndex

TemplateArgs

template arguments

Examples

static struct S
{
    auto lightConst()() const @property { return S(); }

    auto fun(size_t ct_param = 1)(size_t rt_param) const
    {
        return rt_param + ct_param;
    }
}

S s;

auto sfun = aliasCall!"fun"(s);
assert(sfun(3) == 4);

auto sfun10 = aliasCall!("fun", 10)(s);   // uses fun!10
assert(sfun10(3) == 13);

Meta