1 #ifndef INCLUDED_ObjexxFCL_Chunk_hh
2 #define INCLUDED_ObjexxFCL_Chunk_hh
34 template<
typename T >
42 template<
typename >
friend class Chunk;
91 template<
typename U >
162 template<
typename U >
187 if (
size_ != size_a ) {
226 template<
typename U >
240 template<
typename U >
306 assert( value !=
T( 0 ) );
372 return (
size_ == 0 );
448 if (
size_ != size_a ) {
451 T *
const new_array(
new T[ size_a ] );
452 for (
size_type i = 0; i < size_c; ++i ) {
453 new_array[ i ] =
array_[ i ];
472 if (
size_ != size_a ) {
475 T *
const new_array(
new T[ size_a ] );
476 for (
size_type i = 0; i < size_c; ++i ) {
477 new_array[ i ] =
array_[ i ];
482 for (
size_type i = size_c; i < size_a; ++i ) {
496 if (
size_ != size_a ) {
515 if (
size_ != size_a ) {
535 T *
const new_array(
new T[ capacity_a ] );
537 new_array[ i ] =
array_[ i ];
552 T *
const new_array( (
size_ > 0 ?
new T[
size_ ] : 0 ) );
554 new_array[ i ] =
array_[ i ];
648 template<
typename T >
654 template<
typename T >
660 template<
typename T >
668 #ifndef NO_STD_SWAP_OVERLOADS
683 template<
typename T >
695 #endif // NO_STD_SWAP_OVERLOADS
698 #endif // INCLUDED_ObjexxFCL_Chunk_HH
size_type size_
Number of elements in use.
Chunk & assign(size_type const size_a, T const &value)
Size + Value Assignment.
bool operator!=(byte const &i, byte const &j)
byte != byte
T const & front() const
First Element.
Chunk(Chunk const &c)
Copy Constructor.
Chunk & operator=(Chunk const &c)
Copy Assignment.
Chunk & operator-=(Chunk const &c)
-= Chunk
Chunk & pop_back()
Remove the Last Element.
Chunk & operator*=(T const &value)
*= Value
static void swap(T &x, T &y)
Chunk & operator+=(Chunk const &c)
+= Chunk
Chunk()
Default Constructor.
T const & const_reference
size_type capacity_
Number of elements it can hold without resizing.
Chunk & reserve(size_type const capacity_a)
Reserve: Values Preserved: Added Built-In Values are Not Initialized!
Chunk(size_type const size_a, T const &value)
Size + Uniform Value Constructor.
size_type capacity() const
Capacity.
Chunk & resize(size_type const size_a, T const &value)
Resize + Fill Value: Values Preserved.
Chunk & non_preserving_resize(size_type const size_a, T const &value)
Resize + Fill Value: Values Not Preserved.
size_type size() const
Size.
Chunk(Chunk< U > const &c)
Copy Constructor Template.
Chunk & push_back(T const &value)
Append an Element.
Chunk & non_preserving_resize(size_type const size_a)
Resize: Values Not Preserved: Built-In Values are Not Initialized!
size_type max_size() const
Maximum Size.
T const & back() const
Last Element.
Chunk & operator/=(T const &value)
/= Value
bool empty() const
Empty?
T const & operator[](size_type const i) const
Chunk[ i ] const: 0-Based Indexing.
friend bool operator==(Chunk const &a, Chunk const &b)
Chunk == Chunk.
T & front()
First Element.
Chunk & shrink()
Shrink Capacity to Size.
Chunk(size_type const size_a)
Size Constructor: Built-In Types are Not Initialized!
friend bool operator!=(Chunk const &a, Chunk const &b)
Chunk != Chunk.
void swap(CArray< T > &a, CArray< T > &b)
Swap.
Chunk: Contiguous Array for Use in ChunkVector.
bool operator==(byte const &i, byte const &j)
byte == byte
Chunk & resize(size_type const size_a)
Resize: Values Preserved: Added Built-In Values are Not Initialized!