refl-cpp
refl::descriptor::function_descriptor< T, N > Class Template Reference

Represents a reflected function. More...

#include <refl.hpp>

Public Types

template<typename... Args>
using return_type = decltype(member::invoke(std::declval< Args >()...))
 
- Public Types inherited from refl::descriptor::member_descriptor_base< T, N >
typedef T declaring_type
 
typedef member::member_type member_type
 
typedef trait::as_type_list_t< std::remove_cv_t< decltype(member::attributes)> > attribute_types
 

Public Member Functions

template<typename... Args>
constexpr auto operator() (Args &&... args) const -> decltype(invoke(std::declval< Args >()...))
 

Static Public Member Functions

template<typename... Args>
static constexpr auto invoke (Args &&... args) -> decltype(member::invoke(std::declval< Args >()...))
 
template<typename Pointer >
static constexpr bool can_resolve ()
 
template<typename Pointer >
static constexpr auto resolve ()
 

Static Public Attributes

static constexpr auto pointer { detail::get_function_pointer<member>(0) }
 
static constexpr bool is_resolved { !std::is_same_v<decltype(pointer), const decltype(nullptr)> }
 
- Static Public Attributes inherited from refl::descriptor::member_descriptor_base< T, N >
static constexpr type_descriptor< T > declarator { }
 
static constexpr auto name { member::name }
 
static constexpr auto attributes { member::attributes }
 

Additional Inherited Members

- Protected Types inherited from refl::descriptor::member_descriptor_base< T, N >
typedef refl_impl::metadata::type_info__< T >::template member< N > member
 

Detailed Description

template<typename T, size_t N>
class refl::descriptor::function_descriptor< T, N >

Represents a reflected function.

Member Typedef Documentation

◆ return_type

template<typename T , size_t N>
template<typename... Args>
using refl::descriptor::function_descriptor< T, N >::return_type = decltype(member::invoke(std::declval<Args>()...))

The return type of an invocation of this member with Args... (as if by invoke(...)).

Member Function Documentation

◆ can_resolve()

template<typename T , size_t N>
template<typename Pointer >
static constexpr bool refl::descriptor::function_descriptor< T, N >::can_resolve ( )
inlinestaticconstexpr

Whether the pointer can be resolved as with the specified type.

◆ invoke()

template<typename T , size_t N>
template<typename... Args>
static constexpr auto refl::descriptor::function_descriptor< T, N >::invoke ( Args &&...  args) -> decltype(member::invoke(std::declval<Args>()...))
inlinestaticconstexpr

Invokes the function with the given arguments. If the function is an instance function, a reference to the instance is provided as first argument.

◆ operator()()

template<typename T , size_t N>
template<typename... Args>
constexpr auto refl::descriptor::function_descriptor< T, N >::operator() ( Args &&...  args) const -> decltype(invoke(std::declval<Args>()...))
inlineconstexpr

A synonym for invoke(args...).

◆ resolve()

template<typename T , size_t N>
template<typename Pointer >
static constexpr auto refl::descriptor::function_descriptor< T, N >::resolve ( )
inlinestaticconstexpr

Resolves the function pointer as being of type Pointer. Required when taking a pointer to an overloaded function.

Member Data Documentation

◆ is_resolved

template<typename T , size_t N>
constexpr bool refl::descriptor::function_descriptor< T, N >::is_resolved { !std::is_same_v<decltype(pointer), const decltype(nullptr)> }
staticconstexpr

Whether the pointer member was correctly resolved to a concrete implementation. If this field is false, resolve() would need to be called instead.

◆ pointer

template<typename T , size_t N>
constexpr auto refl::descriptor::function_descriptor< T, N >::pointer { detail::get_function_pointer<member>(0) }
staticconstexpr

Returns a pointer to a non-overloaded function.


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