Guest User

Untitled

a guest
Feb 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #define FLUSSPFERD_FN_CREATE_NATIVE_OBJECT(z, n_args, d) \
  2. template< \
  3. typename T \
  4. BOOST_PP_ENUM_TRAILING_PARAMS(n_args, typename T) \
  5. > \
  6. T &create_native_object( \
  7. object proto \
  8. BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(n_args, T, const & param) \
  9. ) { \
  10. if (!proto.is_valid()) \
  11. proto = get_current_context().get_prototype<T>(); \
  12. local_root_scope scope; \
  13. object obj = detail::create_native_object(proto); \
  14. return *(new T(obj BOOST_PP_ENUM_TRAILING_PARAMS(n_args, param))); \
  15. } \
  16. \
  17. template< \
  18. typename T \
  19. BOOST_PP_ENUM_TRAILING_PARAMS(n_args, typename T) \
  20. > \
  21. T &create_native_object( \
  22. object proto \
  23. BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(n_args, T, const & param) \
  24. , \
  25. typename boost::enable_if< \
  26. typename T::class_info::custom_enumerate >::type * = 0 \
  27. ) { \
  28. if (!proto.is_valid()) \
  29. proto = get_current_context().get_prototype<T>(); \
  30. local_root_scope scope; \
  31. object obj = detail::create_native_enumerable_object(proto); \
  32. return *(new T(obj BOOST_PP_ENUM_TRAILING_PARAMS(n_args, param))); \
  33. } \
  34. /**/
Add Comment
Please, Sign In to add comment