Why is object.opEquals not defined as pure?

Muahmmad Adel via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 19 01:03:09 PDT 2015


The following method definition is not possible because 
object.opEquals is not defined as pure.

private pure ushort GetTypeHexadecimalValue(TypeInfo myType)
	{
		if (myType == typeid(byte))
			return 0x01;
		// some similar lines for other different basic types

		throw new  Exception("Unknown type passed");
	}

What is the reason behind this? is opEquals modifying any global 
or object member variables?


More information about the Digitalmars-d mailing list