Support Class Library
A set of tools providing classes and utility
fn_cast.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <type_traits>
6 
7 namespace scl{
8  namespace tools{
9  namespace meta{
18  template <class From, class Ret, class... Args>
19  inline constexpr fn_type<Ret, Args...> fn_cast(From f){
20  return static_cast<fn_type<Ret, Args...>>(f);
21  }
22 
32  template <class From, class Class, class Ret, class... Args>
33  inline constexpr memfn_type<Class, Ret, Args...> fn_cast(From f){
34  return static_cast<memfn_type<Class, Ret, Args...>>(f);
35  }
36  }
37  }
38 }
Ret(*)(Args...) fn_type
An handy type alias to describe function pointer types.
Definition: fn_type.h:15
Global namespace of the SCL.
Definition: alias.hpp:3
Ret(Class::*)(Args...) memfn_type
An handy type alias to describe member function pointer types.
Definition: fn_type.h:24
constexpr fn_type< Ret, Args... > fn_cast(From f)
Cast a function from its type to determined type.
Definition: fn_cast.h:19