has_post_decrement.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // (C) Copyright 2009-2011 Frederic Bron.
  2. //
  3. // Use, modification and distribution are subject to the Boost Software License,
  4. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt).
  6. //
  7. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  8. #ifndef BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED
  9. #define BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED
  10. #include <boost/type_traits/is_array.hpp>
  11. #define BOOST_TT_TRAIT_NAME has_post_decrement
  12. #define BOOST_TT_TRAIT_OP --
  13. #define BOOST_TT_FORBIDDEN_IF\
  14. (\
  15. /* bool */\
  16. ::boost::is_same< bool, Lhs_nocv >::value || \
  17. /* void* */\
  18. (\
  19. ::boost::is_pointer< Lhs_noref >::value && \
  20. ::boost::is_void< Lhs_noptr >::value\
  21. ) || \
  22. /* (fundamental or pointer) and const */\
  23. (\
  24. ( \
  25. ::boost::is_fundamental< Lhs_nocv >::value || \
  26. ::boost::is_pointer< Lhs_noref >::value\
  27. ) && \
  28. ::boost::is_const< Lhs_noref >::value\
  29. )||\
  30. /* Arrays */ \
  31. ::boost::is_array<Lhs_noref>::value\
  32. )
  33. #include <boost/type_traits/detail/has_postfix_operator.hpp>
  34. #undef BOOST_TT_TRAIT_NAME
  35. #undef BOOST_TT_TRAIT_OP
  36. #undef BOOST_TT_FORBIDDEN_IF
  37. #if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
  38. namespace boost {
  39. template <class R>
  40. struct has_post_decrement<bool, R> : public false_type {};
  41. template <>
  42. struct has_post_decrement<bool, boost::binary_op_detail::dont_care> : public false_type {};
  43. template <>
  44. struct has_post_decrement<bool, void> : public false_type {};
  45. template <class R>
  46. struct has_post_decrement<bool&, R> : public false_type {};
  47. template <>
  48. struct has_post_decrement<bool&, boost::binary_op_detail::dont_care> : public false_type {};
  49. template <>
  50. struct has_post_decrement<bool&, void> : public false_type {};
  51. }
  52. #endif
  53. #endif