You are viewing a single comment's thread. Return to all comments →
It wasn't so challenging enough, so I have over engineered it!
#include <type_traits> template<typename Type> auto operator<<( std::ostream& out, const Type& person) -> std::enable_if_t<std::is_same<Person, Type>::value, std::ostream&> { return out << "first_name=" << person.get_first_name() << ",last_name=" << person.get_last_name(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Overloading Ostream Operator
You are viewing a single comment's thread. Return to all comments →
It wasn't so challenging enough, so I have over engineered it!