Iterate through list of pointers
<p>I'm trying to iterate through a list of Window object pointers with this code:</p>

<pre><code>    auto windowPtr = reinterpret_cast&lt;std::list&lt;Window&gt;*&gt;(lParam);

    for (std::list&lt;Window*&gt;::const_iterator it = windowPtr.begin(); it != windowPtr.end(); ++it)
    {
        if ((*it)-&gt;handle == hwnd)
        {
            state = true;
        }
    }
</code></pre>

<p>But I get an error marking <code>windowPtr.begin()</code> and <code>windowPtr.end()</code> saying: </p>

<pre><code>std::list&lt;Window&gt; *windowPtr   Error: expression must have class type
</code></pre>

<p>What am I doing wrong here?</p>