diff --git a/prelude/more_ostreaming.hpp b/prelude/more_ostreaming.hpp index dfe8cb2..71d225a 100644 --- a/prelude/more_ostreaming.hpp +++ b/prelude/more_ostreaming.hpp @@ -337,6 +337,31 @@ inline std::basic_ostream & #endif +#if __cplusplus >= 201103 + +#include + +template +inline std::basic_ostream & + operator<<(std::basic_ostream & o, std::unique_ptr const & p) +{ + if (p) o << p.get(); + else o << "nullptr"; + return o; +} + +template +inline std::basic_ostream & + operator<<(std::basic_ostream & o, std::shared_ptr const & p) +{ + if (p) o << p.get(); + else o << "nullptr"; + return o; +} + +#endif + + #endif // header guard #ifdef MORE_OSTREAMING_TEST