// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*- // vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi #ifndef CTL_ADD_POINTER_H_ #define CTL_ADD_POINTER_H_ #include "remove_reference.h" namespace ctl { // Primary template template struct add_pointer { typedef typename remove_reference::type* type; }; // Specialization for functions template struct add_pointer { typedef R (*type)(Args...); }; // Specialization for function references template struct add_pointer { typedef R (*type)(Args...); }; // Specialization for rvalue references to functions template struct add_pointer { typedef R (*type)(Args...); }; // Helper alias template (C++14 and later) template using add_pointer_t = typename add_pointer::type; } // namespace ctl #endif // CTL_ADD_POINTER_H_