Alias getSymbols

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

Important property of such symbols is that they are likely to need an explicit import if used in some other scope / module.

Implementation is incomplete and tuned for REST interface generation needs.

Declaration

module vibe.internal.meta.codegen;

// ...
alias getSymbols(T) = NoDuplicates!(Implementation!T);
// ...

Parameters

NameDescription
T type to introspect for qualified symbols

Returns

tuple of "interesting" symbols, no duplicates

Example

import std.typetuple : TypeTuple;

struct A {}
interface B {}
alias Type = A[const(B[A*])];

// can't directly compare tuples thus comparing their string representation
static assert (getSymbols!Type.stringof == TypeTuple!(A, B).stringof);
static assert (getSymbols!int.stringof == TypeTuple!().stringof);

Authors

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

Copyright

© 2013 RejectedSoftware e.K.

License

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