Skip to content
Snippets Groups Projects
Commit 38565ec4 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add a specialization to write complex data (EmbeddedData)

parent 750a785a
No related branches found
No related tags found
1 merge request!126Begin socket handling: core functionalities are available
......@@ -23,6 +23,17 @@ class OStream
return os;
}
template <typename DataT>
friend std::shared_ptr<const OStream>
operator<<(const std::shared_ptr<const OStream>& os, const std::shared_ptr<const DataT>& t)
{
Assert(os.use_count() > 0, "non allocated stream");
if (os->m_ostream != nullptr) {
*os->m_ostream << *t;
}
return os;
}
OStream(std::ostream& os) : m_ostream(&os) {}
OStream() = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment