![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/thread-self/root/usr/include/boost/icl/detail/ |
Upload File : |
/*-----------------------------------------------------------------------------+ Copyright (c) 2007-2010: Joachim Faulhaber +------------------------------------------------------------------------------+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENCE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +-----------------------------------------------------------------------------*/ #ifndef BOOST_ICL_MAPALGO_HPP_JOFA_080225 #define BOOST_ICL_MAPALGO_HPP_JOFA_080225 #include <boost/mpl/and.hpp> #include <boost/mpl/or.hpp> #include <boost/mpl/not.hpp> #include <boost/icl/detail/notate.hpp> #include <boost/icl/detail/set_algo.hpp> #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) // conditional expression is constant #endif namespace boost{namespace icl { namespace Map { template <class ObjectT, class CoObjectT> bool intersects(const ObjectT& left, const CoObjectT& right) { typedef typename CoObjectT::const_iterator co_iterator; co_iterator right_common_lower_, right_common_upper_; if(!Set::common_range(right_common_lower_, right_common_upper_, right, left)) return false; co_iterator right_ = right_common_lower_; while(right_ != right_common_upper_) if(!(left.find(key_value<CoObjectT>(right_++))==left.end())) return true; return false; } template<class MapT> typename MapT::const_iterator next_proton(typename MapT::const_iterator& iter_, const MapT& object) { while( iter_ != object.end() && (*iter_).second == identity_element<typename MapT::codomain_type>::value()) ++iter_; return iter_; } /** Function template <tt>lexicographical_equal</tt> implements lexicographical equality except for identity_elementic content values. */ template<class MapT> bool lexicographical_distinct_equal(const MapT& left, const MapT& right) { if(&left == &right) return true; typename MapT::const_iterator left_ = left.begin(); typename MapT::const_iterator right_ = right.begin(); left_ = next_proton(left_, left); right_ = next_proton(right_, right); while(left_ != left.end() && right_ != right.end()) { if(!(left_->first == right_->first && left_->second == right_->second)) return false; ++left_; ++right_; left_ = next_proton(left_, left); right_ = next_proton(right_, right); } return left_ == left.end() && right_ == right.end(); } } // namespace Map }} // namespace boost icl #ifdef BOOST_MSVC #pragma warning(pop) #endif #endif