diff --git a/include/Event.h b/include/Event.h index a9c25f0..faf0cf7 100644 --- a/include/Event.h +++ b/include/Event.h @@ -25,6 +25,7 @@ class Connection; template class BasicEvent { public: + friend Connection; using connection = Connection; using event_ptr = std::shared_ptr; public: diff --git a/include/EventConnection.h b/include/EventConnection.h index f410a2d..9e16796 100644 --- a/include/EventConnection.h +++ b/include/EventConnection.h @@ -16,7 +16,8 @@ class BasicEvent; /// A type that represents a handle to an active event connection. template class Connection { -private: +public: + friend BasicEvent; public: Connection(BasicEvent *creator, delegate cb); bool Disconnect(); // Breaks the event connection, but does not destroy the instance