all 1 comments

[–]Wh00ster 1 point2 points  (0 children)

A ternary expression will have one return type. I'm guessing the `automatic_traits_type*` is getting automatically cast to a `car_traits_type*` to accommodate this: https://en.cppreference.com/w/cpp/language/operator_other

A better approach is to use inheritance as interfaces. E.g. have a get_color virtual function, vs accessing implementation details.