szaszm commented on code in PR #1661:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1661#discussion_r1342529913
##########
libminifi/src/core/extension/ExtensionManager.cpp:
##########
@@ -31,9 +31,13 @@ namespace org::apache::nifi::minifi::core::extension {
const std::shared_ptr<logging::Logger> ExtensionManager::logger_ =
logging::LoggerFactory<ExtensionManager>::getLogger();
-ExtensionManager::ExtensionManager() {
- modules_.push_back(std::make_unique<Executable>());
- active_module_ = modules_[0].get();
+ExtensionManager::ExtensionManager()
+ : modules_([] {
+ std::vector<std::unique_ptr<Module>> modules;
+ modules.push_back(std::make_unique<Executable>());
+ return modules;
+ }()),
Review Comment:
Shoot, apparently the elements of an initializer_list are always passed by
const reference, so it always attempts to copy...
https://stackoverflow.com/questions/8468774/can-i-list-initialize-a-vector-of-move-only-type
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]