function_ptr_3.hpp 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. Copyright (c) 2016 Modified Work Barrett Adair
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. HEADER GUARDS INTENTIONALLY OMITTED
  6. DO NOT INCLUDE THIS HEADER DIRECTLY
  7. macros used:
  8. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
  9. the current include (`transaction_safe` or nothing)
  10. BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
  11. tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
  12. BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
  13. BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
  14. BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
  15. the current include (`noexcept` or nothing)
  16. BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
  17. tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
  18. BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
  19. BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
  20. */
  21. template<typename Return, typename... Args>
  22. struct function<
  23. BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
  24. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  25. BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
  26. : default_callable_traits<> {
  27. static constexpr bool value = true;
  28. using traits = function;
  29. using return_type = Return;
  30. using arg_types = std::tuple<Args...>;
  31. using non_invoke_arg_types = arg_types;
  32. using type = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
  33. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
  34. using function_type = Return(Args...);
  35. using qualified_function_type = function_type;
  36. using remove_varargs = type;
  37. using add_varargs =
  38. BOOST_CLBL_TRTS_ST Return (BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  39. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  40. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  41. using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
  42. using remove_noexcept = Return(BOOST_CLBL_TRTS_CC *)(Args...)
  43. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
  44. using add_noexcept = Return(BOOST_CLBL_TRTS_CC *)(Args...)
  45. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  46. BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
  47. using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
  48. using remove_transaction_safe = Return(BOOST_CLBL_TRTS_CC *)(Args...)
  49. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  50. using add_transaction_safe = Return(BOOST_CLBL_TRTS_CC *)(Args...)
  51. BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
  52. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  53. template<typename U>
  54. using apply_member_pointer =
  55. BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC U::*)(Args...)
  56. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  57. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  58. template<typename NewReturn>
  59. using apply_return =
  60. BOOST_CLBL_TRTS_ST NewReturn(BOOST_CLBL_TRTS_CC *)(Args...)
  61. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  62. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  63. template<template<class...> class Container>
  64. using expand_args = Container<Args...>;
  65. using is_member_pointer = std::false_type;
  66. };