TemplateDeclaration

extern (C++) final
class TemplateDeclaration : ScopeDsymbol {}

Constructors

this
this(Loc loc, Identifier ident, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin, bool literal)
Undocumented in source.

Members

Functions

accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.
addInstance
TemplateInstance addInstance(TemplateInstance ti)

Add instance ti to TemplateDeclaration's table of instances. Return a handle we can use to later remove it if it fails instantiation.

declareParameter
RootObject declareParameter(Scope* sc, TemplateParameter tp, RootObject o)

Declare template parameter tp with value o, and install it in the scope sc.

deduceFunctionTemplateMatch
MATCH deduceFunctionTemplateMatch(TemplateInstance ti, Scope* sc, FuncDeclaration fd, Type tthis, Expressions* fargs)

Match function arguments against a specific template function. Input: ti sc instantiation scope fd tthis 'this' argument if !NULL fargs arguments to function Output: fd Partially instantiated function declaration ti.tdtypes Expression/Type deduced template arguments

doHeaderInstantiation
FuncDeclaration doHeaderInstantiation(TemplateInstance ti, Scope* sc2, FuncDeclaration fd, Type tthis, Expressions* fargs)

Limited function template instantiation for using fd.leastAsSpecialized()

evaluateConstraint
bool evaluateConstraint(TemplateInstance ti, Scope* sc, Scope* paramscope, Objects* dedargs, FuncDeclaration fd)

Check to see if constraint is satisfied.

findExistingInstance
TemplateInstance findExistingInstance(TemplateInstance tithis, Expressions* fargs)

Given a new instance tithis of this TemplateDeclaration, see if there already exists an instance. If so, return that existing instance.

getConstraintEvalError
const(char)* getConstraintEvalError(const(char)* tip)

Destructively get the error message from the last constraint evaluation

hasStaticCtorOrDtor
bool hasStaticCtorOrDtor()
Undocumented in source. Be warned that the author may not have intended to support it.
isDeprecated
bool isDeprecated()
Undocumented in source. Be warned that the author may not have intended to support it.
isOverloadable
bool isOverloadable()

We can overload templates.

isTemplateDeclaration
inout(TemplateDeclaration) isTemplateDeclaration()
Undocumented in source. Be warned that the author may not have intended to support it.
isVariadic
TemplateTupleParameter isVariadic()

Check if the last template parameter is a tuple one, and returns it if so, else returns null.

kind
const(char)* kind()
Undocumented in source. Be warned that the author may not have intended to support it.
leastAsSpecialized
MATCH leastAsSpecialized(Scope* sc, TemplateDeclaration td2, Expressions* fargs)

Determine partial specialization order of 'this' vs td2.

matchWithInstance
MATCH matchWithInstance(Scope* sc, TemplateInstance ti, Objects* dedtypes, Expressions* fargs, int flag)

Given that ti is an instance of this TemplateDeclaration, deduce the types of the parameters to this, and store those deduced types in dedtypes[]. Input: flag 1: don't do semantic() because of dummy types 2: don't change types in matchArg() Output: dedtypes deduced arguments Return match level.

overloadInsert
bool overloadInsert(Dsymbol s)

Overload existing TemplateDeclaration 'this' with the new one 's'. Return true if successful; i.e. no conflict.

prot
Prot prot()
Undocumented in source. Be warned that the author may not have intended to support it.
removeInstance
void removeInstance(TemplateInstance ti)

Remove TemplateInstance from table of instances. Input: handle returned by addInstance()

scopeForTemplateParameters
Scope* scopeForTemplateParameters(TemplateInstance ti, Scope* sc)

Create a scope for the parameters of the TemplateInstance ti in the parent scope sc from the ScopeDsymbol paramsym.

syntaxCopy
Dsymbol syntaxCopy(Dsymbol )
Undocumented in source. Be warned that the author may not have intended to support it.
toChars
const(char)* toChars()
Undocumented in source. Be warned that the author may not have intended to support it.
toCharsMaybeConstraints
const(char)* toCharsMaybeConstraints(bool includeConstraints)
Undocumented in source. Be warned that the author may not have intended to support it.
toCharsNoConstraints
const(char)* toCharsNoConstraints()

Similar to toChars, but does not print the template constraints

Static variables

nAdded
uint nAdded;
Undocumented in source.
nFound
uint nFound;
nNotFound
uint nNotFound;
nRemoved
uint nRemoved;
Undocumented in source.

Variables

constraint
Expression constraint;
Undocumented in source.
deprecated_
bool deprecated_;

this template declaration is deprecated

funcroot
FuncDeclaration funcroot;
Undocumented in source.
instances
TemplateInstance[TemplateInstanceBox] instances;
Undocumented in source.
inuse
int inuse;

for recursive expansion detection

isTrivialAlias
bool isTrivialAlias;

matches pattern template Alias(T) { alias Alias = qualifiers(T); }

isTrivialAliasSeq
bool isTrivialAliasSeq;

matches pattern template AliasSeq(T...) { alias AliasSeq = T; }

ismixin
bool ismixin;
Undocumented in source.
isstatic
bool isstatic;
Undocumented in source.
literal
bool literal;
Undocumented in source.
onemember
Dsymbol onemember;
Undocumented in source.
origParameters
TemplateParameters* origParameters;
Undocumented in source.
overnext
TemplateDeclaration overnext;
Undocumented in source.
overroot
TemplateDeclaration overroot;
Undocumented in source.
parameters
TemplateParameters* parameters;
Undocumented in source.
previous
TemplatePrevious* previous;
Undocumented in source.
protection
Prot protection;
Undocumented in source.

Inherited Members

From ScopeDsymbol

members
Dsymbols* members;
Undocumented in source.
symtab
DsymbolTable symtab;
Undocumented in source.
endlinnum
uint endlinnum;
Undocumented in source.
syntaxCopy
Dsymbol syntaxCopy(Dsymbol s)
Undocumented in source. Be warned that the author may not have intended to support it.
search
Dsymbol search(Loc loc, Identifier ident, int flags)

This function is #1 on the list of functions that eat cpu time. Be very, very careful about slowing it down.

importScope
void importScope(Dsymbol s, Prot protection)
Undocumented in source. Be warned that the author may not have intended to support it.
addAccessiblePackage
void addAccessiblePackage(Package p, Prot protection)
Undocumented in source. Be warned that the author may not have intended to support it.
isPackageAccessible
bool isPackageAccessible(Package p, Prot protection, int flags)
Undocumented in source. Be warned that the author may not have intended to support it.
isforwardRef
bool isforwardRef()
Undocumented in source. Be warned that the author may not have intended to support it.
multiplyDefined
void multiplyDefined(Loc loc, Dsymbol s1, Dsymbol s2)
Undocumented in source. Be warned that the author may not have intended to support it.
kind
const(char)* kind()
Undocumented in source. Be warned that the author may not have intended to support it.
findGetMembers
FuncDeclaration findGetMembers()

Look for member of the form: const(MemberInfo)[] getMembers(string); Returns NULL if not found

symtabInsert
Dsymbol symtabInsert(Dsymbol s)
Undocumented in source. Be warned that the author may not have intended to support it.
symtabLookup
Dsymbol symtabLookup(Dsymbol s, Identifier id)

Look up identifier in symbol table.

hasStaticCtorOrDtor
bool hasStaticCtorOrDtor()

Return true if any of the members are static ctors or static dtors, or if any members have members that are.

ForeachDg
alias ForeachDg = int delegate(size_t idx, Dsymbol s)
Undocumented in source.
_foreach
int _foreach(Scope* sc, Dsymbols* members, ForeachDg dg, size_t* pn)

Expands attribute declarations in members in depth first order. Calls dg(size_t symidx, Dsymbol *sym) for each member. If dg returns !=0, stops and returns that value else returns 0. Use this function to avoid the O(N + N^2/2) complexity of calculating dim and calling N times getNth.

isScopeDsymbol
inout(ScopeDsymbol) isScopeDsymbol()
Undocumented in source. Be warned that the author may not have intended to support it.
accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta