normalize_deduced.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Boost.TypeErasure library
  2. //
  3. // Copyright 2011 Steven Watanabe
  4. //
  5. // Distributed under the Boost Software License Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // $Id$
  10. #if !defined(BOOST_PP_IS_ITERATING)
  11. #ifndef BOOST_TYPE_ERASURE_DETAIL_NORMALIZE_DEDUCED_HPP_INCLUDED
  12. #define BOOST_TYPE_ERASURE_DETAIL_NORMALIZE_DEDUCED_HPP_INCLUDED
  13. #include <boost/preprocessor/iteration/iterate.hpp>
  14. #include <boost/preprocessor/repetition/enum.hpp>
  15. #include <boost/preprocessor/repetition/enum_params.hpp>
  16. #include <boost/type_erasure/detail/meta.hpp>
  17. #ifndef BOOST_TYPE_ERASURE_USE_MP11
  18. namespace boost {
  19. namespace type_erasure {
  20. namespace detail {
  21. template<class M, class T>
  22. struct normalize_deduced;
  23. template<class M, class T>
  24. struct normalize_placeholder;
  25. #define BOOST_PP_FILENAME_1 <boost/type_erasure/detail/normalize_deduced.hpp>
  26. #define BOOST_PP_ITERATION_LIMITS (1, BOOST_TYPE_ERASURE_MAX_ARITY)
  27. #include BOOST_PP_ITERATE()
  28. }
  29. }
  30. }
  31. #endif
  32. #endif
  33. #else
  34. #define N BOOST_PP_ITERATION()
  35. #define BOOST_TYPE_ERASURE_NORMALIZE_PLACEHOLDER(z, n, data) \
  36. typename ::boost::type_erasure::detail::normalize_placeholder< \
  37. M, \
  38. BOOST_PP_CAT(U, n) \
  39. >::type
  40. template<class M, template<BOOST_PP_ENUM_PARAMS(N, class T)> class T, BOOST_PP_ENUM_PARAMS(N, class U)>
  41. struct normalize_deduced<M, T<BOOST_PP_ENUM_PARAMS(N, U)> >
  42. {
  43. typedef typename ::boost::type_erasure::deduced<
  44. T<BOOST_PP_ENUM(N, BOOST_TYPE_ERASURE_NORMALIZE_PLACEHOLDER, ~)>
  45. >::type type;
  46. };
  47. #undef BOOST_TYPE_ERASURE_NORMALIZE_PLACEHOLDER
  48. #undef N
  49. #endif