[uClibc-cvs] CVS uClibc++/include

CVS User gkajmowi gkajmowi at codepoet.org
Sun Sep 26 19:18:25 UTC 2004


Update of /var/cvs/uClibc++/include
In directory nail:/tmp/cvs-serv18087/include

Modified Files:
	algorithm iterator string 
Log Message:
Version 0.1.5 refer to changlog.  Primarily bugfixes, standards compliance issues.

--- /var/cvs/uClibc++/include/algorithm	2004/09/17 02:47:50	1.8
+++ /var/cvs/uClibc++/include/algorithm	2004/09/26 19:18:23	1.9
@@ -608,7 +608,7 @@
 			OutputIterator result, Predicate pred)
 	{
 		while(first !=last){
-			if( pred(*first) ){
+			if( !pred(*first) ){
 				*result = *first;
 				++result;
 			}
@@ -913,13 +913,26 @@
 		if(temp_size < output_size){
 			output_size = temp_size;
 		}
-		RandomAccessIterator middle = first;
-		first += output_size;
-		partial_sort(first, middle, last, comp);
-		for(size_t i =0; i < output_size; ++i){
-			result_first[i] = first[i];
+
+		RandomAccessIterator middle = result_first + output_size;
+		RandomAccessIterator temp = result_first;
+
+		while(temp != middle){
+			*temp = *first;
+			++temp;
+			++first;
 		}
-		return (result_first + output_size);
+		sort(result_first, middle, comp);
+
+		while( first != last){
+			if( comp( *first, *(middle-1) ) ){
+				*(middle-1) = *first;
+				sort(result_first, middle, comp);
+			}
+			++first;
+		}
+
+		return middle;
 	}
 	template<class RandomAccessIterator>
 		void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last)
@@ -1446,7 +1459,7 @@
 
 	template<class RandomAccessIterator> void make_heap(RandomAccessIterator first, RandomAccessIterator last){
 		less<typename iterator_traits<RandomAccessIterator>::value_type> c;
-		sort_heap(first, last, c);
+		make_heap(first, last, c);
 	}
 	template<class RandomAccessIterator, class Compare>
 		void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp)
@@ -1460,7 +1473,7 @@
 	template<class RandomAccessIterator, class Compare>
 		void sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp)
 	{
-		sort( reverse_iterator<RandomAccessIterator>(last), reverse_iterator<RandomAccessIterator>(first), comp);
+		sort( first, last, comp);
 	}
 
 
--- /var/cvs/uClibc++/include/iterator	2004/09/08 14:27:06	1.6
+++ /var/cvs/uClibc++/include/iterator	2004/09/26 19:18:23	1.7
@@ -53,15 +53,19 @@
 		typedef charT char_type;
 		typedef traits traits_type;
 		typedef basic_istream<charT,traits> istream_type;
-		istream_iterator() : in_stream(0), value() {}
-		istream_iterator(istream_type& s) : in_stream(&s), value() { }
-		istream_iterator(const istream_iterator<T,charT,traits,Distance>& x) : in_stream(x.in_stream), value(x.value) { }
+		istream_iterator() : in_stream(0), value(0) {}
+		istream_iterator(istream_type& s) : in_stream(&s), value() {
+			*in_stream >> value;
+		}
+		istream_iterator(const istream_iterator<T,charT,traits,Distance>& x)
+			: in_stream(x.in_stream), value(x.value)
+		{ }
 		~istream_iterator() { }
 		const T& operator*() const{
 			return value;
 		}
 		const T* operator->() const{
-			return &(operator*());
+			return &value;
 		}
 		istream_iterator<T,charT,traits,Distance>& operator++() {
 			*in_stream >> value;
--- /var/cvs/uClibc++/include/string	2004/09/17 02:47:51	1.6
+++ /var/cvs/uClibc++/include/string	2004/09/26 19:18:23	1.7
@@ -341,7 +341,7 @@
 	}
 
 	iterator erase(iterator position){
-		if(position == end()){
+		if(position == vector<Ch, A>::end()){
 			return position;
 		}
 
@@ -349,7 +349,7 @@
 
 		iterator temp = position;
 
-		while(position != end()){
+		while(position != vector<Ch, A>::end()){
 			*(position-1) = *position;
 			++position;
 		}
@@ -362,7 +362,7 @@
 
 		iterator temp = last;
 
-		while(last != end()){
+		while(last != vector<Ch, A>::end()){
 			*(last - count) = *last;
 			++last;
 		}



More information about the uClibc-cvs mailing list