fgerlits commented on a change in pull request #887:
URL: https://github.com/apache/nifi-minifi-cpp/pull/887#discussion_r482109667



##########
File path: libminifi/include/utils/GeneralUtils.h
##########
@@ -68,6 +68,21 @@ using void_t = void;
 using std::void_t;
 #endif /* < C++17 */
 
+namespace internal {
+
+struct safe_enable_shared_from_this_base : 
std::enable_shared_from_this<safe_enable_shared_from_this_base> {
+  virtual ~safe_enable_shared_from_this_base() = default;
+};
+
+}  // namespace internal
+
+template<typename T>
+struct safe_enable_shared_from_this : virtual 
internal::safe_enable_shared_from_this_base {
+  std::shared_ptr<T> shared_from_this() {

Review comment:
       That's true.  How about `EnableSharedFromThis<T>` and 
`sharedFromThis()`?  (Idea taken from here: 
https://www.codeproject.com/Articles/286304/Solution-for-multiple-enable-shared-from-this-in-i)




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to