Coding is breaking when port from GCC 3.1.2 to 4.2.2
<pre><code>    // Standard Template Library example
#include &lt;iostream&gt;
#include &lt;list&gt;
using namespace std;
// Simple example uses type int
main()
{
    list&lt;int&gt; L;
    L.push_back(0);              // Insert a new element at the end
    L.push_front(0);             // Insert a new element at the beginning
    L.insert(++L.begin(),2);     // Insert "&lt;/span&gt;&lt;span title="Convert this amount" class="currency_converter_link"&gt;2&lt;/span&gt;&lt;span class="currency_converter_text"&gt;" before position of first argument
                                // (Place before second argument)
    L.push_back(5);
    L.push_back(6);

    static list&lt;int&gt;::iterator itr = 0 ;

    if(itr == L.end())
    {
        cout &lt;&lt;"itr is equal to NULL;)" ;
    }
    else 
    {
         cout &lt;&lt;"Not NULL ";
    }


    for(itr=L.begin(); itr != L.end(); ++itr) 
        cout &lt;&lt; *itr &lt;&lt; " ";

    cout &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>I have about code which is very simple, and throwing a simple error.</p>

<pre><code>iterator.cpp:16:29: error: conversion from 'int' to non-scalar type 'std::list&lt;i
nt&gt;::iterator' requested
</code></pre>

<p>I m quite new to C++, what is best way to deal with this error so that code well compilable.
Just for information, its porting issue when you switch same code from GCC 3.1.2 to 4.2.2.
basically whole question is knitted around one line that is </p>

<pre><code>static list&lt;int&gt;::iterator itr = 0 ;
</code></pre>

<p>as if someone guide me good document to read about these iterators. As old GCC was accepting these things or just throwing warning, but now they are considering this and error.
I am curious that as we assign NUL to pointer and compare against NULL, what is equivalent when it comes to iterator.</p>

<p>Kindly help.
Thanks ...</p>
