123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef BOOST_LOG_UTILITY_FUNCTIONAL_ENDS_WITH_HPP_INCLUDED_
- #define BOOST_LOG_UTILITY_FUNCTIONAL_ENDS_WITH_HPP_INCLUDED_
- #include <boost/log/detail/config.hpp>
- #include <boost/log/detail/header.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- BOOST_LOG_OPEN_NAMESPACE
- struct ends_with_fun
- {
- typedef bool result_type;
- template< typename T, typename U >
- bool operator() (T const& left, U const& right) const
- {
- typedef typename T::const_reverse_iterator left_iterator;
- typedef typename U::const_reverse_iterator right_iterator;
- left_iterator left_it = left.rbegin(), left_end = left.rend();
- right_iterator right_it = right.rbegin(), right_end = right.rend();
- for (; left_it != left_end && right_it != right_end; ++left_it, ++right_it)
- {
- if (*left_it != *right_it)
- break;
- }
- return right_it == right_end;
- }
- };
- BOOST_LOG_CLOSE_NAMESPACE
- }
- #include <boost/log/detail/footer.hpp>
- #endif
|