@ -85,29 +85,33 @@ class vector {
value_type * get ( ) const { return beginPtr ; }
value_type * get ( ) const { return beginPtr ; }
void allocate ( size_type size ) {
void allocate ( size_type size ) {
if ( size > 0 ) {
// assume that allocation will produce non-empty vector regardless of the
beginPtr = __infer_skip__get_nondet_val < value_type > ( ) ;
// size
} else {
// if (size > 0) {
beginPtr = nullptr ;
beginPtr = __infer_skip__get_nondet_val < value_type > ( ) ;
}
//} else {
// deallocate();
//}
}
}
void deallocate ( ) { beginPtr = nullptr ; }
template < class Iter >
template < class Iter >
void allocate_iter ( Iter begin , Iter end ) {
void allocate_iter ( Iter begin , Iter end ) {
if ( begin ! = end ) {
if ( begin ! = end ) {
allocate ( 1 ) ;
allocate ( 1 ) ;
} else {
} else {
allocate( 0 ) ;
de allocate( ) ;
}
}
}
}
/* std::vector implementation */
/* std::vector implementation */
vector ( ) noexcept ( is_nothrow_default_constructible < allocator_type > : : value ) {
vector ( ) noexcept ( is_nothrow_default_constructible < allocator_type > : : value ) {
allocate( 0 ) ;
de allocate( ) ;
}
}
explicit vector ( const allocator_type & __a ) noexcept { allocate( 0 ) ; }
explicit vector ( const allocator_type & __a ) noexcept { de allocate( ) ; }
explicit vector ( size_type __n ) ;
explicit vector ( size_type __n ) ;
// introduced in C++14
// introduced in C++14
@ -251,7 +255,7 @@ class vector {
iterator erase ( const_iterator __position ) ;
iterator erase ( const_iterator __position ) ;
iterator erase ( const_iterator __first , const_iterator __last ) ;
iterator erase ( const_iterator __first , const_iterator __last ) ;
void clear ( ) noexcept { allocate( 0 ) ; }
void clear ( ) noexcept { de allocate( ) ; }
void resize ( size_type __sz ) ;
void resize ( size_type __sz ) ;
void resize ( size_type __sz , const_reference __x ) ;
void resize ( size_type __sz , const_reference __x ) ;