class_member_traits.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/detail/preprocessed/class_member_traits.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  5. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/class_member_traits.hpp")
  6. #endif
  7. ///////////////////////////////////////////////////////////////////////////////
  8. // class_member_traits.hpp
  9. // Contains specializations of the class_member_traits\<\> class template.
  10. //
  11. // Copyright 2008 Eric Niebler. Distributed under the Boost
  12. // Software License, Version 1.0. (See accompanying file
  13. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  14. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  15. #pragma wave option(preserve: 1)
  16. #endif
  17. #define BOOST_PP_ITERATION_PARAMS_1 \
  18. (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/class_member_traits.hpp>))
  19. #include BOOST_PP_ITERATE()
  20. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(output: null)
  22. #endif
  23. #else
  24. #define N BOOST_PP_ITERATION()
  25. template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
  26. struct class_member_traits<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A))>
  27. {
  28. typedef U class_type;
  29. typedef T result_type;
  30. };
  31. template<typename T, typename U BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
  32. struct class_member_traits<T (U::*)(BOOST_PP_ENUM_PARAMS(N, A)) const>
  33. {
  34. typedef U class_type;
  35. typedef T result_type;
  36. };
  37. #undef N
  38. #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES