overload_names.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED
  2. #define BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED
  3. // Copyright Aleksey Gurtovoy 2004
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/mpl for documentation.
  10. // $Id$
  11. // $Date$
  12. // $Revision$
  13. #include <boost/mpl/aux_/ptr_to_ref.hpp>
  14. #include <boost/mpl/aux_/config/operators.hpp>
  15. #if defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING)
  16. # include <boost/mpl/aux_/static_cast.hpp>
  17. # define BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY operator/
  18. # define BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER operator|
  19. # define BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY operator||
  20. # define BOOST_MPL_AUX_OVERLOAD_IS_MASKED operator%
  21. # define BOOST_MPL_AUX_OVERLOAD_CALL_VALUE_BY_KEY(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) / x
  22. # define BOOST_MPL_AUX_OVERLOAD_CALL_ITEM_BY_ORDER(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) | x
  23. # define BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) || x
  24. # define BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) % x
  25. #else
  26. # define BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY value_by_key_
  27. # define BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER item_by_order_
  28. # define BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY order_by_key_
  29. # define BOOST_MPL_AUX_OVERLOAD_IS_MASKED is_masked_
  30. # define BOOST_MPL_AUX_OVERLOAD_CALL_VALUE_BY_KEY(T, x) T::BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY( BOOST_MPL_AUX_PTR_TO_REF(T), x )
  31. # define BOOST_MPL_AUX_OVERLOAD_CALL_ITEM_BY_ORDER(T, x) T::BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER( BOOST_MPL_AUX_PTR_TO_REF(T), x )
  32. # define BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(T, x) T::BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY( BOOST_MPL_AUX_PTR_TO_REF(T), x )
  33. # define BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(T, x) T::BOOST_MPL_AUX_OVERLOAD_IS_MASKED( BOOST_MPL_AUX_PTR_TO_REF(T), x )
  34. #endif
  35. #endif // BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED