const_reverse_operator prob

G

Gernot Frisch

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<
>::iterator,
struct A_POINT,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<
>::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
 
K

Kristo

Gernot said:
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,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<

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
 
G

Gernot Frisch

Gernot said:
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,struct A_POINT &,
struct A_POINT *,int>'

cannot be converted to

'class std::reverse_iterator<
class std::deque<

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top