The OpenD Programming Language

reflectMeta

Attribute to rename methods, types and functions

template reflectMeta(string target, string[] fields)
reflectMeta
(
Args...
)
(
Args args
)
if (
args.length <= fields.length
)

Members

Functions

reflectMeta
auto reflectMeta(Args args)

Examples

enum E { A, B, C }

struct S
{
    int a;
    @reflectMeta!("c++", ["type"])(E.C)
    int b;
}

import std.traits: hasUDA;

alias CppMeta = ReflectMeta!("c++", ["type"]);

static assert(CppMeta!E(E.C).type == E.C);
static assert(!hasUDA!(S.a, CppMeta!E(E.A)));
static assert(hasUDA!(S.b, CppMeta!E(E.C)));

Meta