lordgamez commented on PR #2261:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2261#issuecomment-5640259343

   > Ownership of UA_NodeId is transferred to the RAII wrapper in its 
constructor, so I'd annotate the constructor parameter and the data member as 
owner.
   > 
   > > Also, the id_ member is of type UA_NodeId, not UA_NodeId*, and 
gsl::owner can only be applied to a pointer type.
   > 
   > I wasn't sure about this restriction, but if gsl::owner only applies to 
pointer types, then indeed we can't use it for this, and a comment is the best 
we can do.
   
   I see now, that was the source of my confusion. Making it at construction 
would make sense, but when I checked the definition I saw that it can only be 
applied to a pointer, so I didn't understand where we would use it, that's why 
I pointed out previously that the `UA_NodeId` member itself is stack allocated. 
We can add a comment if nothing else.
   
   ```
   template <class T, std::enable_if_t<std::is_pointer<T>::value, bool> = true>
   using owner = T;
   ```


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