Mail Archives: djgpp/1996/08/14/02:16:26
Xref: | news2.mv.net comp.os.msdos.djgpp:7230
|
From: | Wolfram Brenig <brenig>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | HELP!: STL's deque & rotate problem!!
|
Date: | 13 Aug 1996 15:07:29 GMT
|
Organization: | Institute of Theoretical Physics, University of Cologne, Germany
|
Lines: | 57
|
Message-ID: | <4uq5nh$ale@news.rrz.uni-koeln.de>
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi, (2nd try ... c'mon you DJGPP gurus ...)
anybody out there who would like to help me with the following problem
I have with DJGPP's STL-lib.
I have to apply STL's generic 'rotate' algorithm to a class deque<int>.
Up until today I thought there should be no problem with the code
caricature below (or at least I did not experience any problems using
similar things on other compilers).
#include <algo.h>
#include <vector.h>
#include <deque.h>
int main() {
//vector<char> v;
deque<char> v;
v.push_back('a');
v.push_back('b'); //not a long one...but sufficient
rotate(v.begin(),v.begin()+1,v.end());
return EXIT_SUCCESS;
}
However, when I compile this using: gcc -g foo.cc -lstdcxx, my DJGPP
compiler talks to me strangely:
c:/djgpp/lang/cxx/algo.h: In function `void rotate(class deque<char>::
iterator, class deque<char>::iterator, class deque<char>::iterator)':
c:/djgpp/lang/cxx/algo.h:520: type unification failed for function
template `template <class T, class Distance> Distance * distance_type
(input_iterator<...> &)'
c:/djgpp/lang/cxx/algo.h:521: type unification failed for function
template `template <class T, class Distance> struct input_iterator_tag
iterator_category(input_iterator<...> &)'
Let alone, that I dont have any clue what this friendly message is about,
even more strangely, if I replace deque<int> by vector<int>, as shown
in the commented lines, everything works perfect ???? My STL reference
keeps telling me that this must not happen.... What's wrong here ????
Any help is most appreciated. Mailing your comments directly to me
would be very kind of you.
Thanks :-)
________________________________________________________________________
Wolfram Brenig | Tel: +49-(0)-221-470-4309 (office)
Universitaet zu Koeln | -3479 (secr.)
Institut fuer Theoretische Physik |
Zuelpicher Str. 77 | FAX: +49-(0)-221-470-5159
50937 Koeln | Email: brenig AT thp DOT uni-koeln DOT de
GERMANY |
- Raw text -