Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::stl_detail Namespace Reference

Classes

struct  has_reverse_iterators
 Detect if a container has reverse iterators. More...
 
struct  has_reverse_iterators< T, std::void_t< decltype(std::declval< T >().rbegin()), decltype(std::declval< T >().rend())> >
 
struct  has_size
 Detect if a type has a size() method. More...
 
struct  has_size< T, std::void_t< decltype(std::declval< T >().size())> >
 
struct  is_std_hashable
 Detect if a type is hashable via std::hash. More...
 
struct  is_std_hashable< T, std::void_t< decltype(std::hash< T >{}(std::declval< T >()))> >
 

Functions

template<typename Container >
size_t safe_size (const Container &c)
 Helper to get container size safely (returns 0 for containers without size())
 
template<typename Result , typename Container >
void try_reserve (Result &result, const Container &c)
 Helper to reserve if possible.
 
template<typename Result >
void try_reserve_n (Result &result, size_t n)
 Helper to reserve with a specific size if the result supports it.
 

Variables

constexpr size_t ADAPTIVE_THRESHOLD = 64
 Threshold for switching from linear to hash-based algorithms.
 
template<typename T >
constexpr bool has_size_v = has_size<T>::value
 
template<typename T >
constexpr bool is_std_hashable_v = is_std_hashable<T>::value
 
template<typename T >
constexpr bool has_reverse_iterators_v = has_reverse_iterators<T>::value
 

Function Documentation

◆ safe_size()

template<typename Container >
size_t Aleph::stl_detail::safe_size ( const Container c)

Helper to get container size safely (returns 0 for containers without size())

Definition at line 137 of file ah-stl-functional.H.

References Aleph::maps().

Referenced by Aleph::stl_distinct(), Aleph::stl_group_by(), and Aleph::stl_take_last().

◆ try_reserve()

template<typename Result , typename Container >
void Aleph::stl_detail::try_reserve ( Result &  result,
const Container c 
)

Helper to reserve if possible.

Definition at line 147 of file ah-stl-functional.H.

References Aleph::maps().

Referenced by Aleph::stl_enumerate_to_pairs(), Aleph::stl_map(), Aleph::stl_mapi(), and Aleph::stl_unzip_pairs().

◆ try_reserve_n()

template<typename Result >
void Aleph::stl_detail::try_reserve_n ( Result &  result,
size_t  n 
)

Helper to reserve with a specific size if the result supports it.

Definition at line 155 of file ah-stl-functional.H.

Variable Documentation

◆ ADAPTIVE_THRESHOLD

constexpr size_t Aleph::stl_detail::ADAPTIVE_THRESHOLD = 64
inlineconstexpr

Threshold for switching from linear to hash-based algorithms.

Definition at line 97 of file ah-stl-functional.H.

Referenced by Aleph::stl_distinct(), and Aleph::stl_group_by().

◆ has_reverse_iterators_v

template<typename T >
constexpr bool Aleph::stl_detail::has_reverse_iterators_v = has_reverse_iterators<T>::value
inlineconstexpr

Definition at line 133 of file ah-stl-functional.H.

◆ has_size_v

template<typename T >
constexpr bool Aleph::stl_detail::has_size_v = has_size<T>::value
inlineconstexpr

Definition at line 108 of file ah-stl-functional.H.

◆ is_std_hashable_v

template<typename T >
constexpr bool Aleph::stl_detail::is_std_hashable_v = is_std_hashable<T>::value
inlineconstexpr

Definition at line 120 of file ah-stl-functional.H.