C++ Manipulator not being executed
<p>Well, I'm wondering why <code>endd</code> doesn't seem to execute (though it doesn't generate any error at compilation time).</p>

<pre><code>struct dxfDato
{
    dxfDato(int c, string v = 0, int t = 0) { codigo = c; valor = v; tipo = t; }
    dxfDato() { }

    int tipo;
    int codigo;
    string valor;
};
class dxfItem
{
private:
    std::ostringstream ss;
    typedef std::ostream&amp; (*manip)(std::ostream&amp;);

public:
    int clase;
    string valor;
    vector&lt;dxfDato&gt; datos;
    vector&lt;dxfItem&gt; hijos;

    template &lt;typename T&gt;
    dxfItem&amp; operator&lt;&lt;(const T&amp; x)
    {
        ss &lt;&lt; x;
        return *this;
    }
    dxfItem&amp; operator&lt;&lt;(manip x) // to store std manipulators
    {
        ss &lt;&lt; x;
        return *this;
    }
    static dxfItem&amp; endd(dxfItem&amp; i) // specific manipulator 'endd'
    {
        dxfDato dd;
        dd.valor = i.ss.str();
        i.datos.push_back(dd);

        std::cout &lt;&lt; "endd found!" &lt;&lt; endl;
        return i;
    }
};

/* blah blah blah */

dxfItem header;

header
    &lt;&lt; 9 &lt;&lt; endl &lt;&lt; "$ACADVER" &lt;&lt; endl &lt;&lt; 1 &lt;&lt; endl &lt;&lt; "AC1500" &lt;&lt; endl
    &lt;&lt; dxfItem::endd // this apparently doesn't execute anything
    &lt;&lt; "other data" &lt;&lt; endl
;
</code></pre>

<p>This is the last problem that I found while trying to develop something. Last thing was exposed here: <a href="http://stackoverflow.com/questions/2199043/c-operator-overloading-example">http://stackoverflow.com/questions/2199043/c-operator-overloading-example</a></p>

<p>Thank you all!</p>
