50
bool MatchTemplateArgList::matches (MatchTemplateArgList &sig_mtal) const {
51
const_iterator iter = begin ();
52
const_iterator sig_iter = sig_mtal.begin ();
53
while (iter != end ()) {
54
// check if the current template match arg is '...'
55
if ((*iter)->is_ellipses ())
57
// check if we have more match arguments than template arguments
58
if (sig_iter == sig_mtal.end ())
60
// check if the current match argument matches the template argument
61
else if (!(*iter)->matches (*(*sig_iter)))
63
// go to the next argument
67
// check if we have examined all deduced template arguments
68
if (sig_iter != sig_mtal.end ())
71
// everything fine, the list matches!
50
75
bool MTA_Type::matches (DeducedArgument *arg) const {
51
76
return arg->Type () && _match_type.matches (arg->Type ());
79
bool MTA_Type::matches (MatchTemplateArg &arg) const {
80
return arg.is_type () && _match_type.matches (((MTA_Type&)arg)._match_type);
54
83
bool MTA_Value::matches (DeducedArgument *arg) const {
55
84
// TODO: more kinds of values
56
85
CConstant *val = arg->Value ();
57
86
return val && (val->isSigned () || val->isUnsigned ()) &&
58
87
val->convert_to_int () == _val;
90
bool MTA_Value::matches (MatchTemplateArg &arg) const {
91
return arg.is_value () && _val == ((MTA_Value&)arg)._val;