<p>I have just converted a project from Visual Studio 2003 to 2005 and although most of it 'converted' fine, I have a series of STL errors from the following line:</p>

<pre><code>void SomeFn( std::vector&lt;CSomeObject*&gt;::iterator it,
std::vector&lt;CSomeObject*&gt;::iterator itBegin = NULL,
std::vector&lt;CSomeObject*&gt;::iterator itEnd = NULL );
</code></pre>

<p>The Visual Studio error is as follows:</p>

<pre><code>c:\&lt;path&gt;\Headerfile.h(20) : error C2440: 'default argument' : cannot convert from 'int' to 'std::_Vector_iterator&lt;_Ty,_Alloc&gt;'
        with
        [
            _Ty=CObject *,
            _Alloc=std::allocator&lt;CObject *&gt;
        ]
        No constructor could take the source type, or constructor overload resolution was ambiguous
</code></pre>

<p>I can't see anything wrong with that code and it worked perfectly in VS 2003. Any ideas?</p>

In 2003,
```
std::vector<T>::iterator
```
is just
```
T *
```
. In 2005, at least in debug mode, it is a class, and hence you can't use
```
NULL
```
for its value (
```
NULL
```
resolves to
```
0
```
).
You can use a default-constructed iterator instead:
```
```
std::vector<CSomeObject*>::iterator itBegin = std::vector<CSomeObject*>::iterator()
```
```