Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::utils::details Namespace Reference

Classes

struct  folder_apply_result
 Helper to get the result type of folder applied with accumulator + tuple elements. More...
 
struct  folder_apply_result< Folder, Accumulator, std::tuple< TupleArgs... > >
 
struct  is_folder_applicable_impl
 Helper to extract tuple element types and check if a folder is invocable with accumulator + tuple elements. More...
 
struct  is_folder_applicable_impl< Folder, Accumulator, std::tuple< TupleArgs... > >
 
struct  UniqueTypesHelper
 
struct  UniqueTypesHelper< T, Rest... >
 

Concepts

concept  TupleLike
 Concept to check if a type is tuple-like (has tuple_size and get).
 
concept  CallableOrApplicable
 
concept  CallableOrApplicableWithReturn
 

Typedefs

template<typename Folder , typename Accumulator , typename Tuple >
using folder_apply_result_t = typename folder_apply_result< Folder, Accumulator, Tuple >::type
 
template<typename Func , typename... Args>
using call_or_apply_result_t = typename decltype(get_call_or_apply_result_type< Func, Args... >())::type
 

Functions

template<typename Func , typename... Args>
consteval auto get_call_or_apply_result_type () noexcept
 Helper to get the result type of either invoke or apply.
 

Variables

template<typename Folder , typename Accumulator , typename Tuple >
constexpr bool is_folder_applicable_v = is_folder_applicable_impl<Folder, Accumulator, Tuple>::value
 

Typedef Documentation

◆ call_or_apply_result_t

template<typename Func , typename... Args>
using helios::utils::details::call_or_apply_result_t = typedef typename decltype(get_call_or_apply_result_type<Func, Args...>())::type
protected

◆ folder_apply_result_t

template<typename Folder , typename Accumulator , typename Tuple >
using helios::utils::details::folder_apply_result_t = typedef typename folder_apply_result<Folder, Accumulator, Tuple>::type
protected

Function Documentation

◆ get_call_or_apply_result_type()

template<typename Func , typename... Args>
consteval auto helios::utils::details::get_call_or_apply_result_type ( )
protectednoexcept

Helper to get the result type of either invoke or apply.

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/utils/functional_adapters.hpp.

Definition at line 62 of file functional_adapters.hpp.

62 {
63 if constexpr (std::invocable<Func, Args...>) {
64 return std::type_identity<std::invoke_result_t<Func, Args...>>{};
65 } else if (sizeof...(Args) == 1) {
66 return std::type_identity<decltype(std::apply(std::declval<Func>(), std::declval<Args>()...))>{};
67 } else {
68 static_assert(sizeof...(Args) == 1,
69 "Callable must be invocable with Args or via std::apply with a single tuple argument");
70 }
71}

Variable Documentation

◆ is_folder_applicable_v

template<typename Folder , typename Accumulator , typename Tuple >
constexpr bool helios::utils::details::is_folder_applicable_v = is_folder_applicable_impl<Folder, Accumulator, Tuple>::value
inlineconstexprprotected