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

Tuple
class Tuple
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
TypeDeduced
class TypeDeduced
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Functions

arrayObjectIsError
bool arrayObjectIsError(Objects* args)

Are any of the Objects an error?

deduceType
MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplateParameters* parameters, Objects* dedtypes, uint* wm, size_t inferStart)
Undocumented in source. Be warned that the author may not have intended to support it.
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

getDsymbol
Dsymbol getDsymbol(RootObject oarg)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
Type getType(RootObject o)

Try to get arg as a type.

isDsymbol
Dsymbol isDsymbol(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
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.

isParameter
Parameter isParameter(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
isTuple
Tuple isTuple(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
isType
Type isType(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
objectSyntaxCopy
RootObject objectSyntaxCopy(RootObject o)
Undocumented in source. Be warned that the author may not have intended to support it.
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.

Manifest constants

IDX_NOTFOUND
enum IDX_NOTFOUND;
Undocumented in source.

Static variables

emptyArrayElement
Expression emptyArrayElement;
Undocumented in source.

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.

TemplatePrevious
struct TemplatePrevious
Undocumented in source.

Meta

Source

See Source File
$(DMDSRC _dtemplate.d)