vson.meta.codegen

Templates and CTFE-functions useful for type introspection during code generation.

Some of those are very similar to traits utilities but instead of general type information focus on properties that are most important during such code generation.

Members

Functions

getRequiredImports
string[] getRequiredImports()

For a given interface I finds all modules that types in its methods come from.

Mixin templates

CloneFunction
mixintemplate CloneFunction(alias Func, string body_, string identifier = __traits(identifier, Func))

A template mixin which allow you to clone a function, and specify the implementation.

Templates

FuncAttributes
template FuncAttributes(alias Func)

Returns a string of the functions attributes, suitable to be mixed on the LHS of the function declaration.

ParameterTuple
template ParameterTuple(alias Func)

Returns a Tuple of the parameters. It can be used to declare function.

ParameterTuple
template ParameterTuple(T, string identifier, TUnused = void)
template ParameterTuple(T, string identifier, T DefVal)

Returns a Tuple containing a 1-element parameter list, with an optional default value. Can be used to concatenate a parameter to a parameter list, or to create one.

getSymbols
template getSymbols(T)

For a given type T finds all user-defined symbols it embeds.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig, Михаил Страшун