diff --git a/types/traits.hpp b/types/traits.hpp index 0281881a..ebb948c2 100644 --- a/types/traits.hpp +++ b/types/traits.hpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2012 Danny Robson + * Copyright 2012-2017 Danny Robson */ #ifndef __UTIL_TYPES_TRAITS_HPP @@ -83,26 +83,6 @@ template struct is_lossless_cast : std::enable_if< >::value { }; -/////////////////////////////////////////////////////////////////////////////// -template -struct func_traits : public func_traits -{ }; - - -//----------------------------------------------------------------------------- -template -struct func_traits { - typedef R return_type; -}; - - -//----------------------------------------------------------------------------- -template -struct func_traits { - typedef R return_type; -}; - - /////////////////////////////////////////////////////////////////////////////// template struct remove_restrict { using type = T; }; template struct remove_restrict { using type = T*; }; @@ -111,4 +91,72 @@ template using remove_restrict_t = typename remove_restrict::type; +/////////////////////////////////////////////////////////////////////////////// +/// removes the noexcept type specifier from invokable types +template +struct remove_noexcept +{ using type = T; }; + + +//----------------------------------------------------------------------------- +template +struct remove_noexcept { + using type = ResultT(&)(Args...); +}; + + +//----------------------------------------------------------------------------- +template +struct remove_noexcept { + using type = ResultT(*)(Args...); +}; + + +//----------------------------------------------------------------------------- +template +struct remove_noexcept { + using type = ResultT(ClassT::*)(Args...); +}; + + +//----------------------------------------------------------------------------- +template +using remove_noexcept_t = typename remove_noexcept::type; + + +/////////////////////////////////////////////////////////////////////////////// +/// type traits class for querying invokable type return values and argument +/// types. +/// +/// if the type is invokable the alias `return_type' will be defined for the +/// return type, and the alias tuple `argument_types' will be defined for the +/// arguments; +template +struct func_traits : public func_traits> { }; + + +//----------------------------------------------------------------------------- +template +struct func_traits { + using return_type = ResultT; + using argument_types = std::tuple; +}; + + +//----------------------------------------------------------------------------- +template +struct func_traits { + using return_type = ResultT; + using argument_types = std::tuple; +}; + + +//----------------------------------------------------------------------------- +template +struct func_traits { + using return_type = ResultT; + using argument_types = std::tuple; +}; + + #endif