has_set_semantics.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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_SET_SEMANTICS_HPP_JOFA_100829
  9. #define BOOST_ICL_TYPE_TRAITS_HAS_SET_SEMANTICS_HPP_JOFA_100829
  10. #include <boost/mpl/or.hpp>
  11. #include <boost/mpl/and.hpp>
  12. #include <boost/icl/type_traits/is_set.hpp>
  13. #include <boost/icl/type_traits/is_map.hpp>
  14. #include <boost/icl/type_traits/codomain_type_of.hpp>
  15. namespace boost{ namespace icl
  16. {
  17. template <class Type> struct has_set_semantics
  18. {
  19. typedef has_set_semantics<Type> type;
  20. BOOST_STATIC_CONSTANT(bool,
  21. value = (mpl::or_< is_set<Type>
  22. , mpl::and_< is_map<Type>
  23. , has_set_semantics
  24. <typename codomain_type_of<Type>::type >
  25. >
  26. >::value));
  27. };
  28. }} // namespace boost icl
  29. #endif