LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
detail::GetAllOverload< Ret, F, Arg >::Functor< Ts > Struct Template Reference

Static Public Member Functions

static Ret call (F &f, const Arg &arg)
 

Static Private Member Functions

template<std::size_t... Is>
static Ret call_helper (F &f, const Arg &arg, index_sequence< Is...>)
 

Detailed Description

template<typename Ret, typename F, typename Arg>
template<typename... Ts>
struct detail::GetAllOverload< Ret, F, Arg >::Functor< Ts >

Definition at line 188 of file visitor.h.

Member Function Documentation

template<typename Ret , typename F , typename Arg >
template<typename... Ts>
static Ret detail::GetAllOverload< Ret, F, Arg >::Functor< Ts >::call ( F &  f,
const Arg &  arg 
)
inlinestatic

Definition at line 191 of file visitor.h.

192  {
193  return call_helper(f, arg, make_index_sequence<sizeof...(Ts)>());
194  }
static Ret call_helper(F &f, const Arg &arg, index_sequence< Is...>)
Definition: visitor.h:198
template<typename Ret , typename F , typename Arg >
template<typename... Ts>
template<std::size_t... Is>
static Ret detail::GetAllOverload< Ret, F, Arg >::Functor< Ts >::call_helper ( F &  f,
const Arg &  arg,
index_sequence< Is...>   
)
inlinestaticprivate

Definition at line 198 of file visitor.h.

199  {
200  using RetTuple = std::tuple<const Ts&...>;
201  // static cast is suffisant if arg is the abstract type
202  // when given arg is concrete type, reinterpret_cast is required.
203  // TODO: build a smaller table with only possible value to avoid that
204 // return f(static_cast<typename std::tuple_element<Is, RetTuple>::type>(std::get<Is>(arg))...);
205  return f(reinterpret_cast<typename std::tuple_element<Is, RetTuple>::type>(std::get<Is>(arg))...);
206  }

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