sysrepo / sysrepo-cpp

C++ bindings for the sysrepo library
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

`sysrepo::Subcription` is not default constructible #6

Closed syyyr closed 7 months ago

syyyr commented 2 years ago

Currently, the only way to have a sysrepo::Subcription as a member, is to either initialize it directly in class member initializer list, or make it into an std::optional<sysrepo::Subcription>.

The first solution is kind of undesirable, because it means that there is a lot of code in the member init-list. The second one means that sometimes, you may forget that to assign the optional on the first subscription (if you're doing multiple subscriptions).

jktjkt commented 7 months ago

I think this is something that we just have to live with.