Is this predicate valid to delete single shared_ptr's? I wrote a predicate used in a remove_if call that deletes shared_ptr's of type StemmedSentence from an vector of sentences. 

The predicate:

class EraseSentenceIf {
    ArrayStemmedSnippet * m_ass;

public:
    EraseSentenceIf(ArrayStemmedSnippet *ass)
    : m_ass(ass) {
    }

    bool operator()(const std::shared_ptr&lt;
        ArrayStemmedSnippet::StemmedSentence&gt;&amp; s) {
        std::shared_ptr&lt;ArrayStemmedSnippet::StemmedSentence&gt; tmp = s;

        // --- set StemmedSentnce object in ArrayStemmedSnippet class
        s-&gt;setParent(m_ass);

        // --- if true delete this sentence)
        if (s-&gt;trimStopWords()) {
            tmp.reset();

            return true;
        }

        return false;
    }
};


The remove_if call:

EraseSentenceIf esi(this);
sentences.erase(
    std::remove_if(
        sentences.begin(), sentences.end(), esi),
    sentences.end()
);


Declaration:

std::vector&lt;shared_ptr&lt;StemmedSentence&gt; &gt; sentences;


The construction of the sentences objects looks like this:

sentences.push_back(shared_ptr&lt;StemmedSentence&gt;(
    new StemmedSentence(index, i - 1 )));


The code seems to run fine, valgrind / gdb does not moan. I just want to get sure that I handle  the deletion (or release) of the shared_ptr in a correct way. Can somebody please confirm this? Maybe I can improve something or I overlooked an important point. Thanks for your comments!
The copy of the pointer is completely unnecessary: as long as the code is not sharing shared_ptrs among threads (which is really, really silly), taking a shared_ptr argument by reference ensures it lives at least until the function finishes executing.
Even if the copy was necessary, passing by reference to immediately make a copy is a pessimisation as it forbids moves. Don't pass shared_ptr by reference if you're going to copy it.
The pointer in the vector will be destroyed by erase, there's no need to manually reset anything.
A predicate that mutates its argument is bound to raise eyebrows. Depending on the semantics of setParent it may or may not be problematic, but it is something I'd avoid if I could.