By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,513 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,513 IT Pros & Developers. It's quick & easy.

const_reverse_operator prob

P: n/a
I'm using #~*&$ VC6 and have this problem:

// good
std::deque<A_POINT>::const_iterator it = p.POINTS.begin();
// bad
std::deque<A_POINT>::const_reverse_iterator it = p.POINTS.rbegin();

// reason:

error C2440: 'initializing' :
'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>
::iterator, struct A_POINT,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>::const_iterator,

struct A_POINT,struct A_POINT const &,
struct A_POINT const *,int>'

Source type was not accepted from any c'tors or ambigious.

Short: The _const_ is freaking out.

Now: How can I print out a deque backwards in VC6?
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
Oct 24 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gernot Frisch wrote:
I'm using #~*&$ VC6 and have this problem:

// good
std::deque<A_POINT>::const_iterator it = p.POINTS.begin();
// bad
std::deque<A_POINT>::const_reverse_iterator it = p.POINTS.rbegin();

// reason:

error C2440: 'initializing' :
'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>
>::iterator,

struct A_POINT,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>
>::const_iterator,

struct A_POINT,struct A_POINT const &,
struct A_POINT const *,int>'

Source type was not accepted from any c'tors or ambigious.

Short: The _const_ is freaking out.

Now: How can I print out a deque backwards in VC6?


What's stopping you from using a regular reverse_iterator? Slap a
comment on it saying something to the effect of "thou shalt not modify
values pointed to by this iterator."

Kristo

Oct 24 '05 #2

P: n/a

"Kristo" <kr*******@gmail.com> schrieb im Newsbeitrag
news:11*********************@o13g2000cwo.googlegro ups.com...
Gernot Frisch wrote:
I'm using #~*&$ VC6 and have this problem:

// good
std::deque<A_POINT>::const_iterator it = p.POINTS.begin();
// bad
std::deque<A_POINT>::const_reverse_iterator it = p.POINTS.rbegin();

// reason:

error C2440: 'initializing' :
'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>
>::iterator,

struct A_POINT,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<
struct A_POINT,class std::allocator<struct A_POINT>
>::const_iterator,

struct A_POINT,struct A_POINT const &,
struct A_POINT const *,int>'

Source type was not accepted from any c'tors or ambigious.

Short: The _const_ is freaking out.

Now: How can I print out a deque backwards in VC6?


What's stopping you from using a regular reverse_iterator? Slap a
comment on it saying something to the effect of "thou shalt not modify
values pointed to by this iterator."

The deque comes from an const argument, thus I can't use a regular
iterator, can I?
Oct 25 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.