/*! @file @copyright Barrett Adair 2015 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS_HPP #define CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS_HPP #include #include #include #define CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(QUAL) \ template \ struct set_function_qualifiers_t < \ flag_map::value, Return, Args... \ > { \ using type = Return(Args...) QUAL; \ }; \ \ template \ struct set_varargs_function_qualifiers_t < \ flag_map::value, Return, Args... \ > { \ using type = Return(Args..., ...) QUAL; \ }; \ \ template \ struct set_varargs_member_function_qualifiers_t < \ flag_map::value, T, Return, Args... \ > { \ using type = \ Return(CALLABLE_TRAITS_VARARGS_CC T::*)(Args..., ...) QUAL;\ } \ /**/ namespace callable_traits { namespace ctdetail { template struct set_function_qualifiers_t { using type = Return(Args...); }; template struct set_varargs_function_qualifiers_t { using type = Return(Args..., ...); }; template struct set_varargs_member_function_qualifiers_t { using type = Return(CALLABLE_TRAITS_VARARGS_CC T::*)(Args..., ...); }; CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(&); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(&&); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(volatile); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const &); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const &&); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(volatile &); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(volatile &&); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const volatile); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const volatile &); CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS(const volatile &&); template using set_function_qualifiers = typename set_function_qualifiers_t::type; template using set_varargs_function_qualifiers = typename set_varargs_function_qualifiers_t::type; template using set_varargs_member_function_qualifiers = typename set_varargs_member_function_qualifiers_t::type; } } #endif //CALLABLE_TRAITS_SET_FUNCTION_QUALIFIERS