allow template function eq to compare equivalent types