Python and C++ code comparison
<p>I have the following <code>python</code> code</p>

<pre><code>for m,n in [(-1,1),(-1,0),(-1,-1)] if 0&lt;=i+m&lt;b and 0&lt;=j+n&lt;l and image[i+m][j+n] == '0']
</code></pre>

<p><code>image</code> is array defined and <code>i</code> and <code>j</code> is also defined.</p>

<p>Following is how I have converted this into <code>C++</code></p>

<pre><code>std::vector&lt;std::pair&lt;int,int&gt; &gt; direction;
direction.push_back(std::make_pair(-1,1));
direction.push_back(std::make_pair(-1,0));
direction.push_back(std::make_pair(-1,-1));
for ( std::vector&lt;std::pair&lt;int,int&gt; &gt;::iterator itr = direction.begin(); 
                   itr != direction.end(); ++itr) {
    int m = (*itr).first;
    int n = (*itr).second;
   if ( (0 &lt;= i + m &amp;&amp; i + m &lt; width ) &amp;&amp; 
                   (0 &lt;= j + n &amp;&amp; j + n &lt; width ) &amp;&amp; 
                   image[i + m][j + n ] == 0) {
}
</code></pre>

<p>Is this conversion correct?</p>
