From 1ce16d63cbed4b152cd113121ecb06fb8358b9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 14 Nov 2017 20:58:01 +0100 Subject: [PATCH] Arrays - Bug fix on resize( ) Default constructor was not being called for new items. --- include/ebcl/inline/Arrays.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ebcl/inline/Arrays.hh b/include/ebcl/inline/Arrays.hh index cfeb1b7..bbde951 100644 --- a/include/ebcl/inline/Arrays.hh +++ b/include/ebcl/inline/Arrays.hh @@ -204,7 +204,7 @@ inline T_Array< T >& T_Array< T >::resize( { if ( size > size_ ) { ensureCapacity( size ); - for ( auto i = size_ ; i < size_ ; i ++ ) { + for ( auto i = size_ ; i < size ; i ++ ) { ::new ( reinterpret_cast< char* >( &data_[ i ] ) ) T( ); } } @@ -220,7 +220,7 @@ inline T_Array< T >& T_Array< T >::resize( { if ( size > size_ ) { ensureCapacity( size ); - for ( auto i = size_ ; i < size_ ; i ++ ) { + for ( auto i = size_ ; i < size ; i ++ ) { ::new ( reinterpret_cast< char* >( &data_[ i ] ) ) T( value ); } }