Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/359
  
    @phrocker I read through the blog post.
    
    The high level objective of this PR is to achieve the "copy free" state. 
The push_back( T&& value ) is what we want.
    
    "in general push_back of already constructed objects with a move 
constructor should be fine"
    
    It would copy, because the string is still valid after we add it (this 
would be "Case B" from the article):
    
     "Case B is not affected (it still copies), and that's good, because we 
want to print s1 to cout below, so we want that data there."
    
    "Case G" is the fit here, since the strings would still be valid. We need 
std::move to say that we're done with the string in this scope and it's OK for 
it to go into arbitrary post-move state.
    
    I'll update to call push_back( T&& value ) which should be copy-free and is 
appropriate because we're not constructing an object.


---

Reply via email to