rlenferink commented on a change in pull request #373: URL: https://github.com/apache/celix/pull/373#discussion_r744268463
########## File path: libs/framework/include/celix/BundleActivator.h ########## @@ -25,73 +25,71 @@ #include "celix_bundle_activator.h" #include "celix/BundleContext.h" -namespace celix { - namespace impl { +namespace celix::impl { - template<typename I> - struct BundleActivatorData { - long bndId; - std::shared_ptr<celix::BundleContext> ctx; - std::unique_ptr<I> bundleActivator; - }; + template<typename I> + struct BundleActivatorData { + long bndId{}; + std::shared_ptr<celix::BundleContext> ctx; + std::unique_ptr<I> bundleActivator; + }; - template<typename I> - typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::BundleContext>>::value, celix_status_t>::type - createActivator(celix_bundle_context_t *cCtx, void **out) { - auto ctx = std::make_shared<celix::BundleContext>(cCtx); - auto act = std::unique_ptr<I>(new I{ctx}); - auto *data = new BundleActivatorData<I>{ctx->getBundleId(), std::move(ctx), std::move(act)}; - *out = (void *) data; - return CELIX_SUCCESS; - } + template<typename I> + typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::BundleContext>>::value, celix_status_t>::type + createActivator(celix_bundle_context_t *cCtx, void **out) { + auto ctx = std::make_shared<celix::BundleContext>(cCtx); + auto act = std::unique_ptr<I>(new I{ctx}); Review comment: Ah, I forgot that the framework [is still at C++11](https://github.com/apache/celix/blob/master/libs/framework/CMakeLists.txt#L22) while the root CMakelists already [is aiming at C++17](https://github.com/apache/celix/blob/master/CMakeLists.txt#L51). In that case I'm also okay with what you have right now. No strong preference from my side. ########## File path: libs/framework/include/celix/BundleActivator.h ########## @@ -25,73 +25,71 @@ #include "celix_bundle_activator.h" #include "celix/BundleContext.h" -namespace celix { - namespace impl { +namespace celix::impl { - template<typename I> - struct BundleActivatorData { - long bndId; - std::shared_ptr<celix::BundleContext> ctx; - std::unique_ptr<I> bundleActivator; - }; + template<typename I> + struct BundleActivatorData { + long bndId{}; + std::shared_ptr<celix::BundleContext> ctx; + std::unique_ptr<I> bundleActivator; + }; - template<typename I> - typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::BundleContext>>::value, celix_status_t>::type - createActivator(celix_bundle_context_t *cCtx, void **out) { - auto ctx = std::make_shared<celix::BundleContext>(cCtx); - auto act = std::unique_ptr<I>(new I{ctx}); - auto *data = new BundleActivatorData<I>{ctx->getBundleId(), std::move(ctx), std::move(act)}; - *out = (void *) data; - return CELIX_SUCCESS; - } + template<typename I> + typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::BundleContext>>::value, celix_status_t>::type + createActivator(celix_bundle_context_t *cCtx, void **out) { + auto ctx = std::make_shared<celix::BundleContext>(cCtx); + auto act = std::unique_ptr<I>(new I{ctx}); + auto *data = new BundleActivatorData<I>{ctx->getBundleId(), std::move(ctx), std::move(act)}; + *out = (void *) data; + return CELIX_SUCCESS; + } - template<typename I> - typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::dm::DependencyManager>>::value, celix_status_t>::type - createActivator(celix_bundle_context_t *cCtx, void **out) { - auto ctx = std::make_shared<celix::BundleContext>(cCtx); - auto dm = ctx->getDependencyManager(); - auto act = std::unique_ptr<I>(new I{dm}); - dm->start(); - auto *data = new BundleActivatorData<I>{ctx->getBundleId(), std::move(ctx), std::move(act)}; - *out = (void *) data; - return CELIX_SUCCESS; - } + template<typename I> + typename std::enable_if<std::is_constructible<I, std::shared_ptr<celix::dm::DependencyManager>>::value, celix_status_t>::type + createActivator(celix_bundle_context_t *cCtx, void **out) { + auto ctx = std::make_shared<celix::BundleContext>(cCtx); + auto dm = ctx->getDependencyManager(); + auto act = std::unique_ptr<I>(new I{dm}); Review comment: Same as https://github.com/apache/celix/pull/373#discussion_r744268463 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org