6static_assert(
sizeof(
alib::integer ) ==
sizeof(std::size_t ),
"Error in ALib type definitions" );
7static_assert(std::is_signed< alib::integer>::value == std::is_signed<std::ptrdiff_t >::value,
"Error in ALib type definitions" );
8static_assert(std::is_signed< alib::integer>::value != std::is_signed<std::size_t >::value,
"Error in ALib type definitions" );
9static_assert(std::is_signed<alib::uinteger>::value == std::is_signed<std::size_t >::value,
"Error in ALib type definitions" );
10static_assert(std::is_signed<alib::uinteger>::value != std::is_signed<std::ptrdiff_t >::value,
"Error in ALib type definitions" );
16#if ALIB_DEBUG && !DOXYGEN
21 extern long double LONGDOUBLE_WRITE_TEST_MEM[2];
22extern void dbgLongDoubleTrueLengthSet();
23extern bool dbgLongDoubleTrueLengthTest();
32 for(
integer i= 0; i < length ; ++i ) {
33 const Box& box= boxArray[i];
35 if( box.IsType<boxing::TBoxes<lang::HeapAllocator>*>() ) {
36 const auto* boxes= box.Unbox<boxing::TBoxes<lang::HeapAllocator>*>();
37 ctdFlattened+= flattenCount( boxes->data(),
integer(boxes->size()) );
41 if( box.IsType<boxing::TBoxes<MonoAllocator>*>() ) {
42 const auto* boxes= box.Unbox<boxing::TBoxes<MonoAllocator>*>();
43 ctdFlattened+= flattenCount( boxes->data(),
integer(boxes->size()) );
46 if( box.IsType<boxing::TBoxes<PoolAllocator>*>() ) {
47 const auto* boxes= box.Unbox<boxing::TBoxes<PoolAllocator>*>();
48 ctdFlattened+= flattenCount( boxes->data(),
integer(boxes->size()) );
53 if( box.IsArrayOf<
Box>() ) {
54 ctdFlattened+= flattenCount( box.UnboxArray<
Box>(), box.
UnboxLength() );
64template<
typename TAllocator>
65void flattenInsert(
typename TBoxes<TAllocator>::iterator& it,
const Box* boxArray,
integer length) {
66 for(
integer i= 0; i < length ; ++i ) {
67 const Box& box= boxArray[i];
69 if( box.IsType<boxing::TBoxes<lang::HeapAllocator>*>() ) {
70 const auto* boxes= box.Unbox<boxing::TBoxes<lang::HeapAllocator>*>();
71 flattenInsert<TAllocator>( it, boxes->data(),
integer(boxes->size()) );
75 if( box.IsType<boxing::TBoxes<MonoAllocator>*>() ) {
76 const auto* boxes= box.Unbox<boxing::TBoxes<MonoAllocator>*>();
77 flattenInsert<TAllocator>( it, boxes->data(),
integer(boxes->size()) );
80 if( box.IsType<boxing::TBoxes<PoolAllocator>*>() ) {
81 const auto* boxes= box.Unbox<boxing::TBoxes<PoolAllocator>*>();
82 flattenInsert<TAllocator>( it, boxes->data(),
integer(boxes->size()) );
87 if( box.IsArrayOf<
Box>() ) {
88 flattenInsert<TAllocator>( it, box.UnboxArray<
Box>(), box.
UnboxLength() );
92 new( &*it )
Box( box );
99template<
typename TAllocator>
102 integer ctdFlattened= flattenCount( boxArray, length );
105 auto it= vectorBase::insert(vectorBase::end(),
size_t(ctdFlattened),
Box() );
108 flattenInsert<TAllocator>( it, boxArray, length);
#define ALIB_ASSERT(cond, domain)
integer UnboxLength() const
void AddArray(const Box *boxArray, integer length)
This namespace implements internals of namespace #"alib::boxing;2".
lang::integer integer
Type alias in namespace #"%alib".
boxing::Box Box
Type alias in namespace #"%alib".
lang::uinteger uinteger
Type alias in namespace #"%alib".