Add generic equality template function