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).
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 anstd::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).