tag_of.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*=============================================================================
  2. Copyright (c) 2010 Christopher Schmidt
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_FUSION_ADAPTED_ARRAY_TAG_OF_HPP
  7. #define BOOST_FUSION_ADAPTED_ARRAY_TAG_OF_HPP
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/support/tag_of_fwd.hpp>
  10. #include <cstddef>
  11. namespace boost
  12. {
  13. namespace fusion
  14. {
  15. struct po_array_tag;
  16. struct po_array_iterator_tag;
  17. struct random_access_traversal_tag;
  18. struct fusion_sequence_tag;
  19. namespace traits
  20. {
  21. #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
  22. template<typename T, std::size_t N>
  23. struct tag_of<T[N], void>
  24. {
  25. typedef po_array_tag type;
  26. };
  27. template<typename T, std::size_t N>
  28. struct tag_of<T const[N], void>
  29. {
  30. typedef po_array_tag type;
  31. };
  32. #else
  33. template<typename T, std::size_t N>
  34. struct tag_of<T[N], void>
  35. {
  36. typedef po_array_tag type;
  37. };
  38. template<typename T, std::size_t N>
  39. struct tag_of<T const[N], void>
  40. {
  41. typedef po_array_tag type;
  42. };
  43. #endif
  44. }
  45. }
  46. namespace mpl
  47. {
  48. template<typename>
  49. struct sequence_tag;
  50. template<typename T, std::size_t N>
  51. struct sequence_tag<T[N]>
  52. {
  53. typedef fusion::po_array_tag type;
  54. };
  55. template<typename T, std::size_t N>
  56. struct sequence_tag<T const[N] >
  57. {
  58. typedef fusion::po_array_tag type;
  59. };
  60. }
  61. }
  62. #endif