Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::parallel_zip_detail::ContainerHolder< Container > Struct Template Reference

Holder for converted containers (either pointer or unique_ptr to vector). More...

#include <ah-parallel.H>

Public Types

using value_type = std::decay_t< decltype(*std::begin(std::declval< Container & >()))>
 
using holder_type = std::conditional_t< parallel_detail::has_random_access< Container >(), const Container *, std::unique_ptr< std::vector< value_type > > >
 

Public Member Functions

 ContainerHolder (const Container &c)
 
decltype(autoget () const
 
size_t size () const noexcept
 Size is always O(1) - either from random access or from cached vector size.
 
auto begin () const
 
auto end () const
 

Public Attributes

holder_type data
 
size_t cached_size
 Cached size for O(1) access.
 

Detailed Description

template<typename Container>
struct Aleph::parallel_zip_detail::ContainerHolder< Container >

Holder for converted containers (either pointer or unique_ptr to vector).

For containers with random access, stores a pointer to the original. For containers without random access (like DynList), copies to a vector.

IMPORTANT: After construction, size() is always O(1) because:

  • Random access containers: std::distance is O(1)
  • Non-random access: already copied to vector, vector.size() is O(1)

Definition at line 1562 of file ah-parallel.H.

Member Typedef Documentation

◆ holder_type

template<typename Container >
using Aleph::parallel_zip_detail::ContainerHolder< Container >::holder_type = std::conditional_t< parallel_detail::has_random_access<Container>(), const Container *, std::unique_ptr<std::vector<value_type> >>

Definition at line 1565 of file ah-parallel.H.

◆ value_type

template<typename Container >
using Aleph::parallel_zip_detail::ContainerHolder< Container >::value_type = std::decay_t<decltype(*std::begin(std::declval<Container &>()))>

Definition at line 1564 of file ah-parallel.H.

Constructor & Destructor Documentation

◆ ContainerHolder()

template<typename Container >
Aleph::parallel_zip_detail::ContainerHolder< Container >::ContainerHolder ( const Container c)
inlineexplicit

Definition at line 1573 of file ah-parallel.H.

Member Function Documentation

◆ begin()

Definition at line 1600 of file ah-parallel.H.

◆ end()

Definition at line 1601 of file ah-parallel.H.

◆ get()

Definition at line 1589 of file ah-parallel.H.

◆ size()

template<typename Container >
size_t Aleph::parallel_zip_detail::ContainerHolder< Container >::size ( ) const
inlinenoexcept

Size is always O(1) - either from random access or from cached vector size.

Definition at line 1598 of file ah-parallel.H.

Member Data Documentation

◆ cached_size

Cached size for O(1) access.

Definition at line 1571 of file ah-parallel.H.

◆ data


The documentation for this struct was generated from the following file: