Commit c295d419 authored by Dominik Charousset's avatar Dominik Charousset

Add `invalid_stream` for initializing stream<T>

parent ba2382d6
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
namespace caf { namespace caf {
struct invalid_stream_t {};
/// Identifies an unbound sequence of messages. /// Identifies an unbound sequence of messages.
template <class T> template <class T>
class stream { class stream {
...@@ -39,6 +41,10 @@ public: ...@@ -39,6 +41,10 @@ public:
// nop // nop
} }
stream(invalid_stream_t) {
// nop
}
inline const stream_id& id() const { inline const stream_id& id() const {
return id_; return id_;
} }
...@@ -52,6 +58,8 @@ private: ...@@ -52,6 +58,8 @@ private:
stream_id id_; stream_id id_;
}; };
constexpr invalid_stream_t invalid_stream = invalid_stream_t{};
} // namespace caf } // namespace caf
#endif // CAF_STREAM_HPP #endif // CAF_STREAM_HPP
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment