Пример #1
0
bool Equals(const Type &type1, const Type &type2)
{
    Type::BaseType t1 = type1.GetBaseType();
    if (t1 != type2.GetBaseType()) {
        return false;
    }

    switch (t1) {
    case Type::BaseType_Enumeration:
        return ((const TypeEnumeration &) type1 ==
                (const TypeEnumeration &) type2);
    case Type::BaseType_Function:
        return ((const TypeFunction &) type1 ==
                (const TypeFunction &) type2);
    case Type::BaseType_Structure:
        return ((const TypeStructure &) type1 ==
                (const TypeStructure &) type2);
    default: // fundamental types
        return (type1 == type2);
    }
}