ddmd.dtemplate

Compiler implementation of the D programming language.

Template implementation.

Members

Classes

TemplateAliasParameter
class TemplateAliasParameter

Syntax: specType ident : specAlias = defaultAlias

TemplateDeclaration
class TemplateDeclaration
TemplateInstance
class TemplateInstance

Given: foo!(args) => name = foo tiargs = args

TemplateMixin
class TemplateMixin
TemplateParameter
class TemplateParameter
TemplateThisParameter
class TemplateThisParameter

Syntax: this ident : specType = defaultType

TemplateTupleParameter
class TemplateTupleParameter

Syntax: ident ...

TemplateTypeParameter
class TemplateTypeParameter

Syntax: ident : specType = defaultType

TemplateValueParameter
class TemplateValueParameter

Syntax: valType ident : specValue = defaultValue

Functions

arrayObjectIsError
bool arrayObjectIsError(Objects* args)

Are any of the Objects an error?

definitelyValueParameter
bool definitelyValueParameter(Expression e)

Return true if e could be valid only as a template value parameter. Return false if it might be an alias or tuple. (Note that even in this case, it could still turn out to be a value).

functionResolve
void functionResolve(Match* m, Dsymbol dstart, Loc loc, Scope* sc, Objects* tiargs, Type tthis, Expressions* fargs)

Given function arguments, figure out which template function to expand, and return matching result. Input: m matching result dstart the root of overloaded function templates loc instantiation location sc instantiation scope tiargs initial list of template arguments tthis if !NULL, the 'this' pointer argument fargs arguments to function

getType
Type getType(RootObject o)

Try to get arg as a type.

isError
bool isError(RootObject o)

Is this Object an error?

isExpression
Expression isExpression(RootObject o)

These functions substitute for dynamic_cast. dynamic_cast does not work on earlier versions of gcc.

unSpeculative
void unSpeculative(Scope* sc, RootObject o)

IsExpression can evaluate the specified type speculatively, and even if it instantiates any symbols, they are normally unnecessary for the final executable. However, if those symbols leak to the actual code, compiler should remark them as non-speculative to generate their code and link to the final executable.

Structs

TemplateInstanceBox
struct TemplateInstanceBox

This struct is needed for TemplateInstance to be the key in an associative array. Fixing https://issues.dlang.org/show_bug.cgi?id=15812 and https://issues.dlang.org/show_bug.cgi?id=15813 would make it unnecessary.

Meta

Source

See Source File
$(DMDSRC _dtemplate.d)