Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 1st, 2005, 01:05 AM
twoeyedhuman1111
Guest
 
Posts: n/a
Default std::reverse_bidirectional_iterator out of date?

I'm trying to port somebodies code from microsl0th to (our good ol)
g++. He uses std::bidirectional_iterator_tag and it says it's
undefined when I include the libraries for it. Here is my sample code:
(not all of it) (of course, the other values have correct
implementations but don't worry about those) (just worry about
reverse_bidirectional_iterator

typedef std::reverse_bidirectional_iterator<iterator,
value_type, reference, pointer, difference_type>
reverse_iterator;

This is the error I get:
tree.cpp:187: error: ISO C++ forbids declaration of `
reverse_bidirectional_iterator' with no type

I included <memory>,<iterator>, and <cassert> but still get that error.
I even looked it up on google, and google said that
std:reverse_bidirectional_iterator is outdated, but SHOULD be included
in <iterator>

Any ideas as to how to get the implementation for
reverse_bidirectional_iterator?

  #2  
Old September 1st, 2005, 01:25 AM
P.J. Plauger
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

"twoeyedhuman1111" <twoeyedhuman1111@gmail.com> wrote in message
news:1125532659.871355.143920@z14g2000cwz.googlegr oups.com...
[color=blue]
> I'm trying to port somebodies code from microsl0th to (our good ol)
> g++. He uses std::bidirectional_iterator_tag and it says it's
> undefined when I include the libraries for it. Here is my sample code:
> (not all of it) (of course, the other values have correct
> implementations but don't worry about those) (just worry about
> reverse_bidirectional_iterator
>
> typedef std::reverse_bidirectional_iterator<iterator,
> value_type, reference, pointer, difference_type>
> reverse_iterator;
>
> This is the error I get:
> tree.cpp:187: error: ISO C++ forbids declaration of `
> reverse_bidirectional_iterator' with no type
>
> I included <memory>,<iterator>, and <cassert> but still get that error.
> I even looked it up on google, and google said that
> std:reverse_bidirectional_iterator is outdated, but SHOULD be included
> in <iterator>
>
> Any ideas as to how to get the implementation for
> reverse_bidirectional_iterator?[/color]

If you were talking about Microsoft Visual C++, you could just
look at the header, but since you're not I can't help you.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


  #3  
Old September 1st, 2005, 03:35 PM
twoeyedhuman1111
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

Well, I'm trying to compile it on linux with g++, since if I can get it
to compile on linux, it will end up compiling just fine with mingw.
Perhaps I should browse <iterator> and see if it includes
std::reverse_bidirectional_iterator?

  #4  
Old September 1st, 2005, 06:25 PM
P.J. Plauger
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

"twoeyedhuman1111" <twoeyedhuman1111@gmail.com> wrote in message
news:1125584748.700008.290000@g49g2000cwa.googlegr oups.com...
[color=blue]
> Well, I'm trying to compile it on linux with g++, since if I can get it
> to compile on linux, it will end up compiling just fine with mingw.[/color]

Modluo the underlying C library, yes.
[color=blue]
> Perhaps I should browse <iterator> and see if it includes
> std::reverse_bidirectional_iterator?[/color]

It's certainly there in VC++. But to cut to the chase, you can
replace reverse_bidirectional_iterator with reverse_iterator
these days. Should work just fine.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


  #5  
Old September 2nd, 2005, 03:05 AM
twoeyedhuman1111
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

Okay, thank you very much!!! You have given me inspiration to try and
debug this microsoft of a mess. :) I will try that!

  #6  
Old September 2nd, 2005, 04:55 AM
twoeyedhuman1111
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

I get errors when I replace reverse_bidirectional_iterator with
reverse_iterator though. For this code:

typedef std::reverse_iterator<iterator,
value_type, reference, pointer, difference_type>
reverse_iterator;
typedef std::reverse_iterator<const_iterator,
value_type, const_reference, const_pointer, difference_type>
const_reverse_iterator;

typedef std::reverse_iterator<child_iterator,
value_type, reference, pointer, difference_type>
reverse_child_iterator;
typedef std::reverse_iterator<const_child_iterator,
value_type, const_reference, const_pointer, difference_type>
const_reverse_child_iterator;

It says:
tree.cpp:187: error: wrong number of template arguments (5, should be
1)
/usr/include/c++/3.3/bits/stl_iterator.h:91: error: provided for `
template<class _Iterator> class std::reverse_iterator'
tree.cpp:187: error: ISO C++ forbids declaration of `reverse_iterator'
with no
type
tree.cpp:190: error: wrong number of template arguments (5, should be
1)
/usr/include/c++/3.3/bits/stl_iterator.h:91: error: provided for `
template<class _Iterator> class std::reverse_iterator'
tree.cpp:190: error: ISO C++ forbids declaration of
`const_reverse_iterator'
with no type
tree.cpp:194: error: wrong number of template arguments (5, should be
1)
/usr/include/c++/3.3/bits/stl_iterator.h:91: error: provided for `
template<class _Iterator> class std::reverse_iterator'
tree.cpp:194: error: ISO C++ forbids declaration of
`reverse_child_iterator'
with no type
tree.cpp:197: error: wrong number of template arguments (5, should be
1)
/usr/include/c++/3.3/bits/stl_iterator.h:91: error: provided for `
template<class _Iterator> class std::reverse_iterator'
tree.cpp:197: error: ISO C++ forbids declaration of `
const_reverse_child_iterator' with no type

I know that I'm passing the wrong number of arguments, but with
reverse_iterator, can I still put in all the information I have above?

  #7  
Old September 2nd, 2005, 02:15 PM
P.J. Plauger
Guest
 
Posts: n/a
Default Re: std::reverse_bidirectional_iterator out of date?

"twoeyedhuman1111" <twoeyedhuman1111@gmail.com> wrote in message
news:1125626311.044449.13640@z14g2000cwz.googlegro ups.com...
[color=blue]
> Okay, thank you very much!!! You have given me inspiration to try and
> debug this microsoft of a mess. :) I will try that![/color]

A word of advice: you will get much better help if you drop
the adolescent habit of slamming vendors. You began this thread
with:

: I'm trying to port somebodies code from microsl0th to (our good ol)
: g++.

and now you've continued it with the remark above. FYI, I'm the
guy who wrote the Standard C++ library shipped with VC++. It's
thus very easy for me to take personally any implications that
the resulting product is either slothful or messy.

Now it so happens that I'm also about the best person around to
answer your questions and give you economical guidance in solving
your problem. I've chose to do so twice despite the fact that
you're being a twit. But I see that you have a posting following
this one asking for more assistance. You can answer your own
question by reading the library headers. I could save you a few
minutes by telling you the answer yet again, but this time I
choose not to.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


 

Bookmarks

Thread Tools

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

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

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles