has_plus.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_PLUS_HPP_INCLUDED
  9. #define BOOST_TT_HAS_PLUS_HPP_INCLUDED
  10. #define BOOST_TT_TRAIT_NAME has_plus
  11. #define BOOST_TT_TRAIT_OP +
  12. #define BOOST_TT_FORBIDDEN_IF\
  13. (\
  14. /* Lhs==pointer and Rhs==pointer */\
  15. (\
  16. ::boost::is_pointer< Lhs_noref >::value && \
  17. ::boost::is_pointer< Rhs_noref >::value\
  18. ) || \
  19. /* Lhs==void* and Rhs==fundamental */\
  20. (\
  21. ::boost::is_pointer< Lhs_noref >::value && \
  22. ::boost::is_void< Lhs_noptr >::value && \
  23. ::boost::is_fundamental< Rhs_nocv >::value\
  24. ) || \
  25. /* Rhs==void* and Lhs==fundamental */\
  26. (\
  27. ::boost::is_pointer< Rhs_noref >::value && \
  28. ::boost::is_void< Rhs_noptr >::value && \
  29. ::boost::is_fundamental< Lhs_nocv >::value\
  30. ) || \
  31. /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\
  32. (\
  33. ::boost::is_pointer< Lhs_noref >::value && \
  34. ::boost::is_fundamental< Rhs_nocv >::value && \
  35. (! ::boost::is_integral< Rhs_noref >::value )\
  36. ) || \
  37. /* Rhs==pointer and Lhs==fundamental and Lhs!=integral */\
  38. (\
  39. ::boost::is_pointer< Rhs_noref >::value && \
  40. ::boost::is_fundamental< Lhs_nocv >::value && \
  41. (! ::boost::is_integral< Lhs_noref >::value )\
  42. )\
  43. )
  44. #include <boost/type_traits/detail/has_binary_operator.hpp>
  45. #undef BOOST_TT_TRAIT_NAME
  46. #undef BOOST_TT_TRAIT_OP
  47. #undef BOOST_TT_FORBIDDEN_IF
  48. #endif