comparison_op.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
  2. // Copyright Aleksey Gurtovoy 2000-2004
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/mpl for documentation.
  9. // $Id$
  10. // $Date$
  11. // $Revision$
  12. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  13. # include <boost/mpl/bool.hpp>
  14. # include <boost/mpl/aux_/value_wknd.hpp>
  15. #endif
  16. #if !defined(AUX778076_OP_PREFIX)
  17. # define AUX778076_OP_PREFIX AUX778076_OP_NAME
  18. #endif
  19. #define AUX778076_OP_ARITY 2
  20. #include <boost/mpl/aux_/numeric_op.hpp>
  21. #include <boost/mpl/aux_/config/static_constant.hpp>
  22. #include <boost/mpl/aux_/config/use_preprocessed.hpp>
  23. #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
  24. && !defined(BOOST_MPL_PREPROCESSING_MODE)
  25. # define BOOST_MPL_PREPROCESSED_HEADER AUX778076_OP_PREFIX.hpp
  26. # include <boost/mpl/aux_/include_preprocessed.hpp>
  27. #else
  28. # include <boost/mpl/aux_/config/integral.hpp>
  29. # include <boost/preprocessor/cat.hpp>
  30. namespace boost { namespace mpl {
  31. // MSVC workaround: implement less in terms of greater
  32. #if 0 AUX778076_OP_TOKEN 1 && !(1 AUX778076_OP_TOKEN 0) && !(0 AUX778076_OP_TOKEN 0)
  33. # define AUX778076_OP(N1, N2) \
  34. ( BOOST_MPL_AUX_VALUE_WKND(N2)::value > BOOST_MPL_AUX_VALUE_WKND(N1)::value ) \
  35. /**/
  36. #else
  37. # define AUX778076_OP(N1, N2) \
  38. ( BOOST_MPL_AUX_VALUE_WKND(N1)::value \
  39. AUX778076_OP_TOKEN BOOST_MPL_AUX_VALUE_WKND(N2)::value \
  40. ) \
  41. /**/
  42. #endif
  43. template<>
  44. struct AUX778076_OP_IMPL_NAME<integral_c_tag,integral_c_tag>
  45. {
  46. template< typename N1, typename N2 > struct apply
  47. #if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
  48. : bool_< AUX778076_OP(N1, N2) >
  49. {
  50. #else
  51. {
  52. BOOST_STATIC_CONSTANT(bool, value = AUX778076_OP(N1, N2));
  53. typedef bool_<value> type;
  54. #endif
  55. };
  56. };
  57. #undef AUX778076_OP
  58. }}
  59. #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  60. #undef AUX778076_OP_TAG_NAME
  61. #undef AUX778076_OP_IMPL_NAME
  62. #undef AUX778076_OP_ARITY
  63. #undef AUX778076_OP_PREFIX
  64. #undef AUX778076_OP_NAME
  65. #undef AUX778076_OP_TOKEN