Pirate Party Ad

måndag 4 augusti 2008

Anledningen till att folk flyr C++

Nu sitter jag här i Lund och knackar kod i C++. Jag tänkte bara visa er en anledning varför inte C++ är ett nybörjarspråk:

Compiling...
AMServer.cpp
c:\program files\microsoft visual studio\vc98\include\utility(23) : error C2664: '__thiscall std::set,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >::std::set,class std::allocato
r >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >(const struct std::l
ess,class std::allocator > > &,const class std::allocator,class std::allocator > > &)' : cannot convert parameter 1 fro
m 'const class std::_Tree,class std::allocator >,class std::basic_string,class std::allocator >,struct std::set,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class
std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >
> >::iterator' to 'const struct std::less,class std::allocator > > &'
Reason: cannot convert from 'const class std::_Tree,class std::allocator >,class std::basic_string,class std::allocator >,struct std::s
et,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator<>,class std::allocator > > >::iterator' to 'const struct std::less,class std::allocator > >'
No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Documents and Settings\Administrator\Desktop\Galder repos\PLC\Galder PLC_Server\trunk\GalderPLC_Server\source\AMServer.cpp(292) : see reference to function template instantiation '__thiscall std::pair,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >,bool>::std::pair,class std::allocator >,struct std::less,class std::alloc
ator > >,class std::allocator,class std::allocator > > >,bool>(const struct std::pair,class std::alloc
ator >,class std::basic_string,class std::allocator >,struct std::set,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator > > >::iterator,bool> &)' being compiled
Generating Code...
Compiling...
GldPlcServer.cpp
Generating Code...
Skipping... (no relevant changes detected)
MyWMISink.cpp
Error executing cl.exe.
Creating browse info file...

GldPlcServer.exe - 1 error(s), 0 warning(s)


Felet löstes genom att ändra en rad kod från
typedef set<string> iterator;
till
typedef set<string>::iterator iterator;
.

Inga kommentarer: