provide << operator for optionals

This commit is contained in:
Joe Thornber
2014-09-04 11:26:43 +01:00
parent 99d851cd29
commit 41354f10f5

View File

@ -26,6 +26,14 @@ using namespace thin_provisioning;
//---------------------------------------------------------------- //----------------------------------------------------------------
namespace { namespace {
template <typename T>
std::ostream &operator << (ostream &out, boost::optional<T> const &maybe) {
if (maybe)
out << *maybe;
return out;
}
class hr_emitter : public emitter { class hr_emitter : public emitter {
public: public:
hr_emitter(ostream &out) hr_emitter(ostream &out)