Standardise getting the effective type (taking ptr and ref into account)