Patch: stl_vector.h

Dhruv Matani dhruvbird@gmx.net
Fri Oct 15 17:57:00 GMT 2004


On Fri, 2004-10-15 at 21:49, Paolo Carlini wrote:
> Dhruv Matani wrote:
> 
> >Sorry, I attached the reverse patch last time around! Stupid me ;-)
> >  
> >
> And where is a short testcase 

vect_test.cpp

> and an explanation and a tentative 
> ChangeLog (which, would necessarily include a minimum of explanation)?

Done.

> 
> Paolo.
-- 
        -Dhruv Matani.
http://www.geocities.com/dhruvbird/

The price of freedom is responsibility, but it's a bargain, because
freedom is priceless. ~ Hugh Downs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vect_test.cpp
Type: text/x-c++
Size: 1883 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20041015/24f1fabb/attachment.bin>
-------------- next part --------------
2004-10-15  Dhruv Matani  <dhruvbird@gmx.net>
	
	* bits/stl_vector.h: _M_initialize_dispatch: Use explicit
	static_cast<> in the call to __uninitialized_fill_n_a() because
	types that can be constructed from an int will not be constructed
	properly.
	
-------------- next part --------------
--- /home/dhruv/projects/cvs_libstdc++-v3/include/bits/stl_vector.h	2004-08-23 17:48:26.000000000 +0530
+++ stl_vector.h	2004-10-15 19:46:30.000000000 +0530
@@ -784,7 +784,8 @@ namespace _GLIBCXX_STD
         {
 	  this->_M_impl._M_start = _M_allocate(__n);
 	  this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
-	  std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+	  std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, 
+					static_cast<value_type>(__value), 
 					this->get_allocator());
 	  this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
 	}


More information about the Libstdc++ mailing list