www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/12/17:54:37

Message-Id: <199608122143.AA13793@sun6.thp.Uni-Koeln.DE>
From: brenig AT thp DOT Uni-Koeln DOT DE (Wolfram Brenig)
Date: Mon, 12 Aug 96 23:43:16 MET DST
To: djgpp AT delorie DOT com
Subject: STL's deque + rotate
Cc: brenig AT thp DOT Uni-Koeln DOT DE

Hi,
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 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');

	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. ???? What's wrong 
here ???? Any help is most appreciated. I am not subscribing to the 
djgpp mailing list so mailing your comments to: brenig AT thp DOT uni-koeln DOT de 
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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019