set0.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
  2. #define BOOST_MPL_SET_AUX_SET0_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/aux_/na.hpp>
  17. #include <boost/mpl/set/aux_/tag.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_SET0_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_SET_OVERLOAD(R, f, X, T) \
  28. BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
  29. /**/
  30. #else
  31. # define BOOST_MPL_AUX_SET0_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_SET_OVERLOAD(R, f, X, T) \
  35. BOOST_MPL_AUX_SET0_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 set0
  40. {
  41. typedef set0<> item_;
  42. typedef item_ type;
  43. typedef aux::set_tag tag;
  44. typedef void_ last_masked_;
  45. typedef void_ item_type_;
  46. typedef long_<0> size;
  47. typedef long_<1> order;
  48. BOOST_MPL_AUX_SET0_OVERLOAD( aux::no_tag, ORDER_BY_KEY, set0<>, void const volatile* );
  49. BOOST_MPL_AUX_SET0_OVERLOAD( aux::yes_tag, IS_MASKED, set0<>, void const volatile* );
  50. };
  51. }}
  52. #endif // BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED