access.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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. #if !defined(FUSION_ACCESS_04182005_0737)
  7. #define FUSION_ACCESS_04182005_0737
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/type_traits/add_const.hpp>
  10. #include <boost/type_traits/add_reference.hpp>
  11. namespace boost { namespace fusion { namespace detail
  12. {
  13. template <typename T>
  14. struct ref_result
  15. {
  16. typedef typename add_reference<T>::type type;
  17. };
  18. template <typename T>
  19. struct cref_result
  20. {
  21. typedef typename
  22. add_reference<
  23. typename add_const<T>::type
  24. >::type
  25. type;
  26. };
  27. template <typename T>
  28. struct call_param
  29. {
  30. typedef T const& type;
  31. };
  32. template <typename T>
  33. struct call_param<T&>
  34. {
  35. typedef T& type;
  36. };
  37. template <typename T>
  38. struct call_param<T const>
  39. {
  40. typedef T const& type;
  41. };
  42. template <typename T>
  43. struct call_param<T volatile>
  44. {
  45. typedef T const& type;
  46. };
  47. template <typename T>
  48. struct call_param<T const volatile>
  49. {
  50. typedef T const& type;
  51. };
  52. }}}
  53. #endif