map0.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef BOOST_MPL_MAP_AUX_MAP0_HPP_INCLUDED
  2. #define BOOST_MPL_MAP_AUX_MAP0_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2003-2004
  4. // Copyright David Abrahams 2003-2004
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11. // $Id$
  12. // $Date$
  13. // $Revision$
  14. #include <boost/mpl/long.hpp>
  15. #include <boost/mpl/void.hpp>
  16. #include <boost/mpl/map/aux_/tag.hpp>
  17. #include <boost/mpl/aux_/na.hpp>
  18. #include <boost/mpl/aux_/yes_no.hpp>
  19. #include <boost/mpl/aux_/overload_names.hpp>
  20. #include <boost/mpl/aux_/config/operators.hpp>
  21. #include <boost/preprocessor/cat.hpp>
  22. namespace boost { namespace mpl {
  23. #if defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING)
  24. # define BOOST_MPL_AUX_MAP0_OVERLOAD(R, f, X, T) \
  25. friend R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
  26. /**/
  27. # define BOOST_MPL_AUX_MAP_OVERLOAD(R, f, X, T) \
  28. BOOST_MPL_AUX_MAP0_OVERLOAD(R, f, X, T) \
  29. /**/
  30. #else
  31. # define BOOST_MPL_AUX_MAP0_OVERLOAD(R, f, X, T) \
  32. static R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
  33. /**/
  34. # define BOOST_MPL_AUX_MAP_OVERLOAD(R, f, X, T) \
  35. BOOST_MPL_AUX_MAP0_OVERLOAD(R, f, X, T); \
  36. using Base::BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f) \
  37. /**/
  38. #endif
  39. template< typename Dummy = na > struct map0
  40. {
  41. typedef map0 type;
  42. typedef aux::map_tag tag;
  43. typedef void_ key_;
  44. typedef long_<1> order;
  45. typedef long_<0> size;
  46. #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
  47. BOOST_MPL_AUX_MAP0_OVERLOAD( aux::type_wrapper<void_>, VALUE_BY_KEY, map0<>, void const volatile* );
  48. BOOST_MPL_AUX_MAP0_OVERLOAD( aux::type_wrapper<void_>, ITEM_BY_ORDER, map0<>, long_<1>* );
  49. BOOST_MPL_AUX_MAP0_OVERLOAD( aux::no_tag, ORDER_BY_KEY, map0<>, void const volatile* );
  50. #else
  51. BOOST_MPL_AUX_MAP0_OVERLOAD( aux::no_tag, ORDER_BY_KEY, map0<>, void const volatile* );
  52. BOOST_MPL_AUX_MAP0_OVERLOAD( aux::no_tag, IS_MASKED, map0<>, void const volatile* );
  53. #endif
  54. };
  55. }}
  56. #endif // BOOST_MPL_MAP_AUX_MAP0_HPP_INCLUDED