Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-11-2006
eric.hill eric.hill is offline
Registered User
 
Name: Eric Hill
Organization: Pioneer Balloon Co.
Project: Internal Research
 
Join Date: Jul 2006
Location: Wichita, KS
Posts: 25
Sequence Iterator Error Message?

I'm trying to iterate over a sequence passed to a servant and getting a compiler error:

Code:
c:\projects\pdfrenderer\slice\rendereri.cpp(14) : error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Ty,_Alloc>' to 'std::_Vector_iterator<_Ty,_Alloc>'
The slice definition is pretty trivial:

Code:
...
	sequence<byte> ByteSeq;
	
	struct File {
		string name;
		ByteSeq contents;
	};
	
	sequence<File> FileSeq;
...
And the code I'm using is:

Code:
void
RendererLib::RenderSvcI::Render(
	const ::RendererLib::Packet& workpacket,
	const Ice::Current& current)
{
	const RendererLib::FileSeq& files = workpacket.what;
	RendererLib::FileSeq::iterator file = files.begin(); // Error here
	while (file_itor != workpacket.what.end()) {
		File afile = *file_itor;
	}
}
What's the right way to iterate over an Ice sequence?
__________________
Eric Hill - ijack.net
Pioneer Balloon Co.
Reply With Quote
  #2 (permalink)  
Old 08-11-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
Your C++ compiler reports the problem: you're trying to assign a const_iterator into an iterator. You should declare file as a RendererLib::FileSeq::const_iterator .

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #3 (permalink)  
Old 08-11-2006
eric.hill eric.hill is offline
Registered User
 
Name: Eric Hill
Organization: Pioneer Balloon Co.
Project: Internal Research
 
Join Date: Jul 2006
Location: Wichita, KS
Posts: 25
Thanks

Well duh.

I need to go home and get some rest. Sigh.

Thanks!
__________________
Eric Hill - ijack.net
Pioneer Balloon Co.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a error message! terminate Help Center 2 10-10-2006 11:46 PM
Error message on "run" exit Larry Help Center 10 07-13-2006 01:54 PM
Questions about sanity-check of sequence sizes during sequence unmarshaling rc_hz Help Center 4 06-22-2005 10:33 PM
Freeze Map iterator should add operator += n -=n dragzhb Comments 4 10-18-2004 11:48 PM
about Freeze::Map::iterator sylvain Comments 4 07-21-2003 12:28 PM


All times are GMT -4. The time now is 11:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.