|
-
November 13th, 2003, 09:18 AM
#1
Compile errors when porting from VC++ 6 to VC++ .Net
I have an existing project which we currently compile (successfully) on VC++ 6.0
I am trying to compile it in VC++ 7 but I get some compile errors which I don't really understand.
1. std:: vector< MyInfo >::iterator ListIter = ...
if( ListIter ) { ... }
I get an error C2451: conditional expression of type 'std::vector<_Ty, Ax>::iterator' is illegal with....
If I change this to the more explicit: if( ListIter != 0 ), it compiles fine.
2. char newData[sizeof( MyInfo )];
std::vector< MyInfo >::iterator ListIter = ...
memcpy( newData, ListIter, sizeof(MyInfo) );
I get an error C2664: cannot convert parameter 2 from std::vector<_Ty,_Ax>::iterator to const void * with...
3. if ( !ListIter ) ...
get an error C2675: unary '!' : 'std::vector< _Ty, _Ax >::const_iterator' does not define this operator or a conversion to a type acceptable to the predefined operator
I don't understand why it doesn't compile in VC7 but it does in VC6. Can anyone help?
Thanks
Stef
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|