martinzink commented on code in PR #1473:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1473#discussion_r1063421130


##########
libminifi/include/utils/ResourceQueue.h:
##########
@@ -126,7 +137,10 @@ struct ResourceQueue<ResourceType>::make_shared_enabler : 
public ResourceQueue<R
 };
 
 template<class ResourceType>
-auto ResourceQueue<ResourceType>::create(std::optional<size_t> 
maximum_number_of_creatable_resources, std::shared_ptr<core::logging::Logger> 
logger) {
-  return 
std::make_shared<make_shared_enabler>(maximum_number_of_creatable_resources, 
std::move(logger));
+auto 
ResourceQueue<ResourceType>::create(std::function<std::unique_ptr<ResourceType>()>
 creator,
+                                         std::optional<size_t> 
maximum_number_of_creatable_resources,
+                                         
std::optional<std::function<void(ResourceType&)>> reset_fn,
+                                         
std::shared_ptr<core::logging::Logger> logger) {
+  return std::make_shared<make_shared_enabler>(std::move(creator), 
maximum_number_of_creatable_resources, std::move(reset_fn), std::move(logger));

Review Comment:
   Unfortunetly this cannot be simplified due to
   
   > According to the C++17 Standard (10.3.3 The using declaration):
   >     19 A synonym created by a using-declaration has the usual 
accessibility for a member-declaration. A using-declarator that names a 
constructor does not create a synonym; instead, the additional constructors are 
accessible if they would be accessible when used to construct an object of the 
corresponding base class, and the accessibility of the using-declaration is 
ignored.
   
   
   I've also created a smaller example in godbolt to double check it
   https://godbolt.org/z/rfzsPcT6s



-- 
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]

Reply via email to