has_inverse.hpp 1.0 KB

1234567891011121314151617181920212223242526272829
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2008-2009: 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_HAS_INVERSE_HPP_JOFA_090205
  9. #define BOOST_ICL_TYPE_TRAITS_HAS_INVERSE_HPP_JOFA_090205
  10. #include <boost/type_traits/is_signed.hpp>
  11. #include <boost/type_traits/is_floating_point.hpp>
  12. namespace boost{ namespace icl
  13. {
  14. template <class Type> struct has_inverse
  15. {
  16. typedef has_inverse<Type> type;
  17. BOOST_STATIC_CONSTANT(bool,
  18. value = ( boost::is_signed<Type>::value
  19. || is_floating_point<Type>::value ) );
  20. };
  21. }} // namespace boost icl
  22. #endif // BOOST_ICL_TYPE_TRAITS_HAS_INVERSE_HPP_JOFA_090205