You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "szaszm (via GitHub)" <gi...@apache.org> on 2023/10/02 10:38:56 UTC
Re: [PR] MINIFICPP-2196 Integrate cppcoreguideline clang-tidy checks in CI [nifi-minifi-cpp]
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org