SignalR-Client-Cpp icon indicating copy to clipboard operation
SignalR-Client-Cpp copied to clipboard

Make hub_connection always a shared_ptr

Open BrennanConroy opened this issue 5 years ago • 2 comments

We talked about replacing the hub_connection_impl and making hub_connection contain all the logic. However, that would require including a lot of internal types in the public header and all sorts of ugliness.

BrennanConroy avatar Jun 25 '20 22:06 BrennanConroy

This change would be great @BrennanConroy. We've recently got this client working in Unreal, but the current API makes it difficult to store a hub_connection in our classes (there's no default or copy constructors). We had to add a default constructor to the class in order to do so.

This change looks like the right kind of solution.

jwittner avatar Mar 02 '21 17:03 jwittner

Looks like there's a move constructor available for hub_connection which allows us to use a shared pointer. But returning a shared pointer directly from the builder would be useful.

TobyGilbert-ms avatar Mar 02 '21 18:03 TobyGilbert-ms