provide << operator for optionals
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user