How to sort std::list<..>
<p>i have a list of Elemtents of a custom type:</p>

<pre><code>std::list&lt;CDataTransferElement*&gt; m_list;
</code></pre>

<p>The class is defined like this:</p>

<pre><code>    class CDataTransferElement
{
public:
    CDataTransferElement(void);
    ~CDataTransferElement(void);

    CString Name;
    double PercentValue;
    double MOLValue;
    int PhaseIndex;

};
</code></pre>

<p>I have x Items in the m_list Object, that have to be sorted by the PhaseIndex Variable in a new Object (what type of ever).
In the end i need x lists of the CDataTransferElement Elements where each list has only Elements with the same PhaseIndex.</p>

<p>How do i do that at best?</p>

<p>regards
camelord </p>
