|
| template<typename Container , typename Pred > |
| bool | Aleph::detail::fallback_all_of (const Container &c, Pred &&pred) |
| |
| template<typename Container , typename Pred > |
| bool | Aleph::detail::fallback_any_of (const Container &c, Pred &&pred) |
| |
| template<typename Container , typename Pred > |
| bool | Aleph::detail::fallback_none_of (const Container &c, Pred &&pred) |
| |
| template<typename Container , typename T , typename BinaryOp > |
| constexpr T | Aleph::detail::ranges_fold_left (Container &&c, T init, BinaryOp &&op) |
| | Fallback fold_left using range-based for loop.
|
| |
| template<typename Container , typename Pred > |
| bool | Aleph::detail::ranges_all_of (const Container &c, Pred &&pred) |
| | Fallback all_of using range-based for loop.
|
| |
| template<typename Container , typename Pred > |
| bool | Aleph::detail::ranges_any_of (const Container &c, Pred &&pred) |
| | Fallback any_of using range-based for loop.
|
| |
| template<typename Container , typename Pred > |
| bool | Aleph::detail::ranges_none_of (const Container &c, Pred &&pred) |
| | Fallback none_of using range-based for loop.
|
| |
| template<typename Container , typename Pred > |
| auto | Aleph::detail::ranges_count_if (const Container &c, Pred &&pred) |
| | Fallback count_if using range-based for loop.
|
| |
C++20 Ranges support and adaptors for Aleph-w containers.
This header provides:
- Range adaptors for Aleph containers (DynList, DynArray, etc.)
- Internal utilities using std::ranges for improved performance
- Lazy range views compatible with Aleph containers
COMPILER AND STANDARD LIBRARY REQUIREMENTS
Minimum Requirements
- C++20 or later (-std=c++20)
- GCC 12+ with libstdc++, OR
- Clang 14+ with libc++ (-stdlib=libc++), OR
- MSVC 19.29+
IMPORTANT: Clang + libstdc++ Incompatibility
Clang 14-15 with libstdc++ (GCC's standard library) has BROKEN std::ranges support. The combination fails to satisfy iterator concepts correctly, causing compilation errors like:
- "no matching function for call to '__begin'"
- "constraints not satisfied for alias template 'sentinel_t'"
- "invalid operands to binary expression"
Solutions (choose one):
- Use libc++ with Clang (RECOMMENDED):
clang++ -
std=c++20 -stdlib=libc++ -lc++abi myfile.cpp
- Use GCC instead of Clang:
g++ -
std=c++20 myfile.cpp
- Upgrade to Clang 16+ (has better libstdc++ compatibility)
Why does this happen?
libc++ is Clang's native C++ standard library with full std::ranges support. libstdc++ is GCC's library; older Clang versions have subtle incompatibilities with its iterator concept implementations.
Usage Example
DynList<int> list = {1, 2, 3, 4, 5};
bool has_even = std::ranges::any_of(list, [](int x) { return x % 2 == 0; });
for (
auto x : list |
std::views::
filter([](int x) {
return x % 2 == 0; }))
std::cout << x << " ";
for (
auto x :
Aleph::lazy_range(1, 10))
C++20 Ranges support and adaptors for Aleph-w containers.
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
Container2< typename Container1::Item_Type > filter(Container1 &container, Operation &operation)
Filter elements that satisfy operation.
- Note
- The public API of ahFunctional.H is preserved. This header provides internal optimizations and additional range-based utilities.
- Author
- Leandro Rabindranath Leon
Definition in file ah-ranges.H.