Flecs: include/flecs/addons/cpp/utils/function_traits.hpp File Reference
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
function_traits.hpp File Reference

Compile-time utilities to inspect properties of functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | flecs::is_callable< T >
| Trait to check if a type is callable. More...
struct | flecs::arity< T >
| Trait to get the number of arguments of a callable. More...
struct | flecs::first_arg_impl< Func, _::arg_list< T, Args ... > >
| Extract the first argument type from an arg_list. More...
struct | flecs::first_arg< Func >
| Get the first argument type of a callable. More...
struct | flecs::second_arg_impl< Func, _::arg_list< First, T, Args ... > >
| Extract the second argument type from an arg_list. More...
struct | flecs::second_arg< Func >
| Get the second argument type of a callable. More...

## Namespaces
namespace | flecs::_
| Int to enum.

## Typedefs
template<typename T>
using | flecs::return_type_t = typename _::function_traits<T>::return_type
| Get the return type of a callable.
template<typename T>
using | flecs::arg_list_t = typename _::function_traits<T>::args
| Get the argument list type of a callable.
template<typename Func>
using | flecs::first_arg_t = typename first_arg<Func>::type
| Convenience alias for the first argument type of a callable.
template<typename Func>
using | flecs::second_arg_t = typename second_arg<Func>::type
| Convenience alias for the second argument type of a callable.

## Detailed Description

Compile-time utilities to inspect properties of functions.

Code from: https://stackoverflow.com/questions/27024238/c-template-mechanism-to-get-the-number-of-function-arguments-which-would-work

Definition in file function_traits.hpp.

## Typedef Documentation

## ◆ arg_list_t

template<typename T>

using flecs::arg_list_t = typename _::function_traits<T>::args

Get the argument list type of a callable.

Definition at line 129 of file function_traits.hpp.

## ◆ first_arg_t

template<typename Func>

using flecs::first_arg_t = typename first_arg<Func>::type

Convenience alias for the first argument type of a callable.

Definition at line 149 of file function_traits.hpp.

## ◆ return_type_t

template<typename T>

using flecs::return_type_t = typename _::function_traits<T>::return_type

Get the return type of a callable.

Definition at line 125 of file function_traits.hpp.

## ◆ second_arg_t

template<typename Func>

using flecs::second_arg_t = typename second_arg<Func>::type

Convenience alias for the second argument type of a callable.

Definition at line 169 of file function_traits.hpp.