function_ptr_varargs_3.hpp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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<BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  23. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  24. BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
  25. : default_callable_traits<> {
  26. static constexpr bool value = true;
  27. using has_varargs = std::true_type;
  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 =
  33. BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  34. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  35. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  36. using function_type = Return(Args..., ...);
  37. using qualified_function_type = function_type;
  38. using remove_varargs =
  39. BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
  40. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
  41. using add_varargs = type;
  42. using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
  43. using remove_noexcept = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args..., ...)
  44. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
  45. using add_noexcept = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args..., ...)
  46. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  47. BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
  48. using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
  49. using remove_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  50. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  51. using add_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  52. BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
  53. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  54. template<typename U>
  55. using apply_member_pointer =
  56. BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC U::*)(Args..., ...)
  57. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  58. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  59. template<typename NewReturn>
  60. using apply_return =
  61. BOOST_CLBL_TRTS_ST NewReturn(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
  62. BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
  63. BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
  64. template<template<class...> class Container>
  65. using expand_args = Container<Args...>;
  66. using is_member_pointer = std::false_type;
  67. };