diff --git a/doc/reference/container/vector.xml b/doc/reference/container/vector.xml
index 9c1f2c54..75ed9290 100644
--- a/doc/reference/container/vector.xml
+++ b/doc/reference/container/vector.xml
@@ -16,6 +16,16 @@
allocator type
+
+
+
+ Note: Unlike std::vector,
+ boost::compute::vector does not initialize values
+ when the created or resized. If initialization is needed you must
+ explicitly call fill() on the newly
+ allocated values.
+
+
diff --git a/include/boost/compute/container/vector.hpp b/include/boost/compute/container/vector.hpp
index 53bcc8a2..baddb342 100644
--- a/include/boost/compute/container/vector.hpp
+++ b/include/boost/compute/container/vector.hpp
@@ -30,7 +30,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -242,17 +241,9 @@ public:
return m_allocator.max_size();
}
- void resize(size_type size, T value = T())
+ void resize(size_type size)
{
if(size < capacity()){
- if(size < m_size){
- ::boost::compute::fill(
- begin() + static_cast(size),
- begin() + static_cast(m_size),
- value
- );
- }
-
m_size = size;
}
else {
@@ -272,9 +263,6 @@ public:
// copy old values to the new buffer
::boost::compute::copy(m_data, m_data + m_size, new_data, queue);
- // fill the rest of the new vector with value
- ::boost::compute::fill(new_data + m_size, new_data + size, value, queue);
-
// free old memory
m_allocator.deallocate(m_data, m_size);