Exemplo n.º 1
0
		bool Predicate::operator==(const Predicate& other) const {
			if (kind() != other.kind()) {
				return false;
			}
			
			switch (kind()) {
				case TRUE:
				case FALSE:
				case SELFCONST:
				{
					return true;
				}
				case AND:
				{
					return andLeft() == other.andLeft() && andRight() == other.andRight();
				}
				case OR:
				{
					return orLeft() == other.orLeft() && orRight() == other.orRight();
				}
				case SATISFIES:
				{
					return satisfiesType() == other.satisfiesType() &&
						satisfiesRequirement() == other.satisfiesRequirement();
				}
				case VARIABLE:
				{
					return variableTemplateVar() == other.variableTemplateVar();
				}
			}
			
			locic_unreachable("Unknown predicate kind.");
		}