2017-11-01 20:14:23 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
/* ARRAYS *********************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _H_EBCL_ARRAYS
|
|
|
|
#define _H_EBCL_ARRAYS
|
2017-11-01 21:44:54 +01:00
|
|
|
#include <ebcl/Externals.hh>
|
|
|
|
#include <ebcl/Pointers.hh>
|
|
|
|
#include <ebcl/Utilities.hh>
|
|
|
|
#include <ebcl/Types.hh>
|
|
|
|
namespace ebcl {
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
|
2017-11-03 11:21:17 +01:00
|
|
|
// TODO:
|
|
|
|
// * add addAll({})
|
|
|
|
// * add ={} / cons({})
|
|
|
|
|
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
/*= DYNAMIC ARRAYS ===========================================================*/
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
template< typename Type >
|
2017-11-01 20:14:23 +01:00
|
|
|
class T_Array final
|
|
|
|
{
|
|
|
|
public:
|
2018-12-16 15:24:40 +01:00
|
|
|
using T_Self = T_Array< Type >;
|
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
static constexpr uint32_t DEFAULT_GROWTH( )
|
|
|
|
{
|
2018-12-16 15:24:40 +01:00
|
|
|
return std::max< uint32_t >( 1 , 4096 / sizeof( Type ) );
|
2017-11-01 20:14:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2018-12-16 15:24:40 +01:00
|
|
|
Type* data_;
|
2017-11-01 20:14:23 +01:00
|
|
|
uint32_t capacity_;
|
|
|
|
uint32_t size_;
|
|
|
|
uint32_t growth_;
|
|
|
|
|
|
|
|
public:
|
2018-12-16 15:24:40 +01:00
|
|
|
M_TEMPLATE_POINTERS( T_Self );
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
T_Array( ) noexcept;
|
|
|
|
explicit T_Array( uint32_t growth ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Array( T_Self const& source ) noexcept;
|
|
|
|
T_Self& operator= ( T_Self const& other ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Array( T_Self&& source ) noexcept;
|
|
|
|
T_Self& operator= ( T_Self&& other ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Array( std::initializer_list< Type > list ) noexcept;
|
|
|
|
T_Self& operator= ( std::initializer_list< Type > list ) noexcept;
|
2017-11-04 12:39:41 +01:00
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
template< typename TP >
|
|
|
|
friend void swap( T_Array< TP >& lhs ,
|
|
|
|
T_Array< TP >& rhs ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
~T_Array( );
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self& clear( ) noexcept;
|
|
|
|
T_Self& free( ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
uint32_t capacity( ) const noexcept;
|
|
|
|
uint32_t size( ) const noexcept;
|
|
|
|
uint32_t growth( ) const noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
bool empty( ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self& ensureCapacity( uint32_t capacity ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2017-11-03 11:21:17 +01:00
|
|
|
template<
|
2018-12-16 15:24:40 +01:00
|
|
|
typename Q = Type ,
|
2017-11-03 11:21:17 +01:00
|
|
|
typename = std::enable_if_t< std::is_default_constructible< Q >::value >
|
2018-12-16 15:24:40 +01:00
|
|
|
> T_Self& resize( const uint32_t size );
|
2017-11-03 11:21:17 +01:00
|
|
|
|
|
|
|
template<
|
2018-12-16 15:24:40 +01:00
|
|
|
typename Q = Type ,
|
2017-11-03 11:21:17 +01:00
|
|
|
typename = std::enable_if_t< std::is_copy_constructible< Q >::value >
|
2018-12-16 15:24:40 +01:00
|
|
|
> T_Self& resize( const uint32_t size ,
|
|
|
|
Type const& value );
|
2017-11-03 11:21:17 +01:00
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& operator[] ( uint32_t index ) noexcept;
|
|
|
|
Type const& operator[] ( uint32_t index ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& last( ) noexcept;
|
|
|
|
Type const& last( ) const noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items (requires comparison operator)
|
2018-12-16 15:24:40 +01:00
|
|
|
int32_t indexOf( Type const& item ) const noexcept;
|
|
|
|
bool contains( Type const& item ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items based on a predicate
|
2018-12-16 15:24:40 +01:00
|
|
|
int32_t indexOf( std::function< bool( Type const& ) > pred ) const noexcept;
|
|
|
|
bool contains( std::function< bool( Type const& ) > pred ) const noexcept;
|
2018-05-09 14:12:27 +02:00
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
uint32_t add( Type const& item ) noexcept;
|
|
|
|
uint32_t add( Type&& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
template< typename... Args >
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& addNew( Args&& ... args );
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self& addAll( T_Self const& other ) noexcept;
|
|
|
|
T_Self& addAll( T_Self&& other ) noexcept;
|
|
|
|
T_Self& addAll( std::initializer_list< Type > values ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self& operator<< ( Type const& item ) noexcept;
|
|
|
|
T_Self& operator<< ( Type&& item ) noexcept;
|
|
|
|
T_Self& operator<< ( T_Self const& other ) noexcept;
|
|
|
|
T_Self& operator<< ( T_Self&& other ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void insert( uint32_t index ,
|
2018-12-16 15:24:40 +01:00
|
|
|
Type const& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
void insert( uint32_t index ,
|
2018-12-16 15:24:40 +01:00
|
|
|
Type&& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
template< typename... Args >
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& insertNew( uint32_t index ,
|
2017-11-01 20:14:23 +01:00
|
|
|
Args&& ... args );
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void remove( uint32_t index ) noexcept;
|
|
|
|
void removeSwap( uint32_t index ) noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
void removeLast( ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
void sort( F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
void sort( uint32_t first ,
|
|
|
|
uint32_t items ,
|
2018-12-16 15:24:40 +01:00
|
|
|
F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self copyRange( uint32_t first ,
|
2017-11-01 20:14:23 +01:00
|
|
|
uint32_t last = UINT32_MAX ) const noexcept;
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self moveRange( uint32_t first ,
|
2017-11-01 20:14:23 +01:00
|
|
|
uint32_t last = UINT32_MAX ) noexcept;
|
2017-11-02 14:23:19 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
2018-12-16 15:24:40 +01:00
|
|
|
// C++ iterators
|
|
|
|
# include "ebcl/bits/ArrayIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/ArrayConstIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/IteratorMethodsDecl.hh"
|
2017-11-01 20:14:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// Instantiate some common types directly
|
|
|
|
extern template class T_Array< uint32_t >;
|
|
|
|
|
|
|
|
|
|
|
|
/*= STATICALLY ALLOCATED ARRAYS ==============================================*/
|
|
|
|
/* These arrays offer the same interface as dynamic arrays, but are in fact
|
|
|
|
* implemented as in-place storage.
|
|
|
|
*/
|
|
|
|
|
|
|
|
template< typename Type , uint32_t Size >
|
|
|
|
class T_StaticArray final
|
|
|
|
{
|
|
|
|
static_assert( Size > 0 , "Size must be greater than 0" );
|
|
|
|
|
|
|
|
public:
|
|
|
|
using T_Self = T_StaticArray< Type , Size >;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Actual storage type
|
|
|
|
using T_Storage_ = std::aligned_storage_t<
|
|
|
|
sizeof( Type ) , alignof( Type )
|
|
|
|
>;
|
|
|
|
|
|
|
|
T_Storage_ storage_[ Size ];
|
|
|
|
uint32_t size_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
M_TEMPLATE_POINTERS( T_Self );
|
|
|
|
|
|
|
|
T_StaticArray( ) noexcept;
|
|
|
|
|
|
|
|
// Copy
|
|
|
|
T_StaticArray( T_Self const& source ) noexcept;
|
|
|
|
T_Self& operator= ( T_Self const& other ) noexcept;
|
|
|
|
|
|
|
|
// Move
|
|
|
|
T_StaticArray( T_Self&& source ) noexcept;
|
|
|
|
T_Self& operator= ( T_Self&& other ) noexcept;
|
|
|
|
|
|
|
|
~T_StaticArray( ) noexcept;
|
|
|
|
T_Self& clear( ) noexcept;
|
|
|
|
|
|
|
|
template< typename T , uint32_t S >
|
|
|
|
friend void swap(
|
|
|
|
T_StaticArray< T , S >& lhs ,
|
|
|
|
T_StaticArray< T , S >& rhs ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
constexpr uint32_t capacity( ) const noexcept;
|
|
|
|
uint32_t size( ) const noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
bool empty( ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
Type& operator[] ( uint32_t index ) noexcept;
|
|
|
|
Type const& operator[] ( uint32_t index ) const noexcept;
|
|
|
|
|
2017-11-03 09:35:14 +01:00
|
|
|
Type& last( ) noexcept;
|
|
|
|
Type const& last( ) const noexcept;
|
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items (requires comparison operator)
|
2017-11-01 20:14:23 +01:00
|
|
|
int32_t indexOf( Type const& item ) const noexcept;
|
|
|
|
bool contains( Type const& item ) const noexcept;
|
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items based on a predicate
|
|
|
|
int32_t indexOf( std::function< bool( Type const& ) > pred ) const noexcept;
|
|
|
|
bool contains( std::function< bool( Type const& ) > pred ) const noexcept;
|
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
uint32_t add( Type&& item ) noexcept;
|
|
|
|
uint32_t add( Type const& item ) noexcept;
|
|
|
|
template< typename... Args >
|
|
|
|
Type& addNew( Args&& ... args );
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self& addAll( T_Self const& other ) noexcept;
|
|
|
|
T_Self& addAll( T_Self&& other ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self& operator<< ( Type const& item ) noexcept;
|
|
|
|
T_Self& operator<< ( Type&& item ) noexcept;
|
|
|
|
T_Self& operator<< ( T_Self const& other ) noexcept;
|
|
|
|
T_Self& operator<< ( T_Self&& other ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void insert( uint32_t index ,
|
|
|
|
Type&& item ) noexcept;
|
|
|
|
void insert( uint32_t index ,
|
|
|
|
Type const& item ) noexcept;
|
|
|
|
template< typename... Args >
|
|
|
|
Type& insertNew( uint32_t index ,
|
|
|
|
Args&& ... args );
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void remove( uint32_t index ) noexcept;
|
|
|
|
void removeSwap( uint32_t index ) noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
void removeLast( ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void sort( F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
|
|
|
void sort( uint32_t first ,
|
|
|
|
uint32_t items ,
|
|
|
|
F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self copyRange( uint32_t first ,
|
|
|
|
uint32_t last = UINT32_MAX ) const noexcept;
|
|
|
|
T_Self moveRange( uint32_t first ,
|
|
|
|
uint32_t last = UINT32_MAX ) noexcept;
|
2018-12-16 15:24:40 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// C++ iterators
|
|
|
|
# include "ebcl/bits/ArrayIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/ArrayConstIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/IteratorMethodsDecl.hh"
|
2017-11-01 20:14:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*= AUTOMATIC ARRAYS =========================================================*/
|
|
|
|
/* Arrays that are stored in-place up to some limit, then transform into
|
|
|
|
* dynamic arrays if necessary.
|
|
|
|
*/
|
|
|
|
|
|
|
|
template<
|
2018-12-16 15:24:40 +01:00
|
|
|
typename Type , uint32_t StaticSize ,
|
2017-11-01 20:14:23 +01:00
|
|
|
uint32_t DynamicGrowth = StaticSize * 4
|
|
|
|
> class T_AutoArray
|
|
|
|
{
|
|
|
|
public:
|
2018-12-16 15:24:40 +01:00
|
|
|
using T_Self = T_AutoArray< Type , StaticSize , DynamicGrowth >;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
private:
|
2018-12-16 15:24:40 +01:00
|
|
|
using T_Static_ = T_StaticArray< Type , StaticSize >;
|
|
|
|
using T_Dynamic_ = T_Array< Type >;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
T_Union< T_Static_ , T_Dynamic_ > array_;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
public:
|
|
|
|
M_TEMPLATE_POINTERS( T_Self );
|
|
|
|
|
|
|
|
T_AutoArray( ) noexcept;
|
|
|
|
|
|
|
|
T_AutoArray( T_Self const& source ) noexcept;
|
|
|
|
T_Self& operator =( T_Self const& source ) noexcept;
|
|
|
|
|
|
|
|
T_AutoArray( T_Self&& source ) noexcept;
|
|
|
|
T_Self& operator =( T_Self&& source ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
template< typename TP , uint32_t S , uint32_t G >
|
|
|
|
friend void swap(
|
|
|
|
T_AutoArray< TP , S , G >& lhs ,
|
|
|
|
T_AutoArray< TP , S , G >& rhs ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self& clear( ) noexcept;
|
|
|
|
T_Self& free( ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
uint32_t capacity( ) const noexcept;
|
|
|
|
uint32_t size( ) const noexcept;
|
|
|
|
constexpr uint32_t growth( ) const noexcept;
|
|
|
|
bool isStatic( ) const noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
bool empty( ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
T_Self& ensureCapacity( uint32_t capacity ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& operator[] ( uint32_t index ) noexcept;
|
|
|
|
Type const& operator[] ( uint32_t index ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& last( ) noexcept;
|
|
|
|
Type const& last( ) const noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items (requires comparison operator)
|
2018-12-16 15:24:40 +01:00
|
|
|
int32_t indexOf( Type const& item ) const noexcept;
|
|
|
|
bool contains( Type const& item ) const noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
2018-05-09 14:12:27 +02:00
|
|
|
// Find items based on a predicate
|
2018-12-16 15:24:40 +01:00
|
|
|
int32_t indexOf( std::function< bool( Type const& ) > pred ) const noexcept;
|
|
|
|
bool contains( std::function< bool( Type const& ) > pred ) const noexcept;
|
2018-05-09 14:12:27 +02:00
|
|
|
|
2017-11-01 20:14:23 +01:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
uint32_t add( Type const& item ) noexcept;
|
|
|
|
uint32_t add( Type&& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
template< typename... Args >
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& addNew( Args&& ... args );
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self& addAll( T_Self const& other ) noexcept;
|
|
|
|
T_Self& addAll( T_Self&& other ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
T_Self& operator<< ( Type const& item ) noexcept;
|
|
|
|
T_Self& operator<< ( Type&& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
T_Self& operator<< ( T_Self const& other ) noexcept;
|
|
|
|
T_Self& operator<< ( T_Self&& other ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void insert( uint32_t index ,
|
2018-12-16 15:24:40 +01:00
|
|
|
Type const& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
void insert( uint32_t index ,
|
2018-12-16 15:24:40 +01:00
|
|
|
Type&& item ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
template< typename... Args >
|
2018-12-16 15:24:40 +01:00
|
|
|
Type& insertNew( uint32_t index ,
|
2017-11-01 20:14:23 +01:00
|
|
|
Args&& ... args );
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
void remove( uint32_t index ) noexcept;
|
|
|
|
void removeSwap( uint32_t index ) noexcept;
|
2017-11-03 09:35:14 +01:00
|
|
|
void removeLast( ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
2018-12-16 15:24:40 +01:00
|
|
|
void sort( F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
void sort( uint32_t first ,
|
|
|
|
uint32_t items ,
|
2018-12-16 15:24:40 +01:00
|
|
|
F_Comparator< Type > cmp = T_Comparator< Type >::compare ) noexcept;
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
T_Self copyRange( uint32_t first ,
|
|
|
|
uint32_t last = UINT32_MAX ) const noexcept;
|
|
|
|
|
|
|
|
T_Self moveRange( uint32_t first ,
|
|
|
|
uint32_t last = UINT32_MAX ) noexcept;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
2018-12-16 15:24:40 +01:00
|
|
|
// C++ iterators
|
|
|
|
# include "ebcl/bits/ArrayIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/ArrayConstIteratorDecl.hh"
|
|
|
|
# include "ebcl/bits/IteratorMethodsDecl.hh"
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
2017-11-01 20:14:23 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void convertToDynamic_( uint32_t capacity ) noexcept;
|
|
|
|
|
|
|
|
T_Static_& static_( ) noexcept;
|
|
|
|
T_Static_ const& static_( ) const noexcept;
|
|
|
|
T_Dynamic_& dynamic_( ) noexcept;
|
|
|
|
T_Dynamic_ const& dynamic_( ) const noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // _H_EBCL_ARRAYS
|
2017-11-01 21:44:54 +01:00
|
|
|
#include <ebcl/inline/Arrays.hh>
|