associated_value.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_DETAIL_ASSOCIATED_VALUE_HPP_JOFA_100829
  9. #define BOOST_ICL_DETAIL_ASSOCIATED_VALUE_HPP_JOFA_100829
  10. #include <boost/icl/detail/design_config.hpp>
  11. #include <boost/icl/type_traits/is_combinable.hpp>
  12. #include <boost/mpl/not.hpp>
  13. #include <boost/mpl/and.hpp>
  14. namespace boost{namespace icl
  15. {
  16. template<class Type, class CoType>
  17. typename enable_if< mpl::and_< is_key_compare_equal<Type,CoType>
  18. , mpl::and_<is_map<Type>, is_map<CoType> > >,
  19. bool>::type
  20. co_equal(typename Type::const_iterator left_, typename CoType::const_iterator right_,
  21. const Type* = 0, const CoType* = 0)
  22. {
  23. return co_value<Type>(left_) == co_value<CoType>(right_);
  24. }
  25. template<class Type, class CoType>
  26. typename enable_if< mpl::and_< is_key_compare_equal<Type,CoType>
  27. , mpl::not_<mpl::and_<is_map<Type>, is_map<CoType> > > >,
  28. bool>::type
  29. co_equal(typename Type::const_iterator, typename CoType::const_iterator,
  30. const Type* = 0, const CoType* = 0)
  31. {
  32. return true;
  33. }
  34. }} // namespace icl boost
  35. #endif