Skip navigation

Error 1 error C2825: ‘_Alloc’: must be a class or namespace when followed by ‘::’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1544


Error 2 error C2039: ‘difference_type’ : is not a member of ‘`global namespace” c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1544
Error 3 error C2146: syntax error : missing ‘,’ before identifier ‘difference_type’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1544
Error 4 error C2065: ‘difference_type’ : undeclared identifier c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1544
Error 5 error C2955: ‘std::_Iterator012’ : use of class template requires template argument list c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1548
Error 6 error C2825: ‘_Alloc’: must be a class or namespace when followed by ‘::’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1550
Error 7 error C2039: ‘size_type’ : is not a member of ‘`global namespace” c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1550
Error 8 error C2146: syntax error : missing ‘;’ before identifier ‘_Sizet’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1550
Error 9 error C4430: missing type specifier – int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1550
Error 10 error C2061: syntax error : identifier ‘_Sizet’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1558
Error 11 error C2061: syntax error : identifier ‘_Sizet’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1565
Error 12 error C2146: syntax error : missing ‘;’ before identifier ‘_Myoff’ c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1582
Error 13 error C4430: missing type specifier – int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1582
Error 14 error C4430: missing type specifier – int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector 1582

Not really an error, occurs when you misuse STL function swap() by adding a type parameter.

Example of code producing the error:

#include <vector>
using namespace std ;

int main()
{
  int a=7, b=5 ;

  swap<int>(a,b) ; // This should be just swap( a, b ) ; with NO <TYPE>
}
Advertisements

One Comment

    • bleater
    • Posted July 28, 2015 at 2:23 am
    • Permalink

    Lifesaver! I have been attempting to debug some code that runs fine under Clang but barfs deep in under VC++, and this note directed me to the source. Thanks!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: