adds_inversely.hpp 998 B

1234567891011121314151617181920212223242526272829
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2010-2010: Joachim Faulhaber
  3. +------------------------------------------------------------------------------+
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENCE.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. +-----------------------------------------------------------------------------*/
  8. #ifndef BOOST_ICL_TYPE_TRAITS_ADDS_INVERSELY_HPP_JOFA_100829
  9. #define BOOST_ICL_TYPE_TRAITS_ADDS_INVERSELY_HPP_JOFA_100829
  10. #include <boost/icl/type_traits/has_inverse.hpp>
  11. #include <boost/icl/functors.hpp>
  12. namespace boost{ namespace icl
  13. {
  14. template<class Type, class Combiner>
  15. struct adds_inversely
  16. {
  17. typedef adds_inversely type;
  18. BOOST_STATIC_CONSTANT(bool,
  19. value = (mpl::and_<has_inverse<Type>, is_negative<Combiner> >::value));
  20. };
  21. }} // namespace boost icl
  22. #endif // BOOST_ICL_TYPE_TRAITS_ADDS_INVERSELY_HPP_JOFA_100829