Modify shared_ptr equality function to use value type equality function, flatten finished now