Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:40

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  Distributed under the Boost Software License, Version 1.0.
0003 //  (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 //  See http://www.boost.org/libs/test for the library home page.
0007 //
0008 //  File        : $RCSfile$
0009 //
0010 //  Version     : $Revision: 74248 $
0011 //
0012 //  Description : support for backward compatible collection comparison interface
0013 // ***************************************************************************
0014 
0015 #ifndef BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER
0016 #define BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER
0017 
0018 #ifdef BOOST_TEST_NO_OLD_TOOLS
0019 
0020 #include <boost/test/detail/suppress_warnings.hpp>
0021 
0022 //____________________________________________________________________________//
0023 
0024 namespace boost {
0025 namespace test_tools {
0026 namespace tt_detail {
0027 
0028 // ************************************************************************** //
0029 // **************       backward compatibility support         ************** //
0030 // ************************************************************************** //
0031 
0032 template<typename It>
0033 struct it_pair {
0034     typedef It const_iterator;
0035     typedef typename std::iterator_traits<It>::value_type value_type;
0036 
0037     it_pair( It const& b, It const& e ) : m_begin( b ), m_size( 0 )
0038     {
0039         It tmp = b;
0040         while( tmp != e ) { ++m_size; ++tmp; }
0041     }
0042 
0043     It      begin() const   { return m_begin; }
0044     It      end() const     { return m_begin + m_size; }
0045     size_t  size() const    { return m_size; }
0046 
0047 private:
0048     It      m_begin;
0049     size_t  m_size;
0050 };
0051 
0052 //____________________________________________________________________________//
0053 
0054 template<typename It>
0055 it_pair<It>
0056 make_it_pair( It const& b, It const& e ) { return it_pair<It>( b, e ); }
0057 
0058 //____________________________________________________________________________//
0059 
0060 template<typename T>
0061 it_pair<T const*>
0062 make_it_pair( T const* b, T const* e ) { return it_pair<T const*>( b, e ); }
0063 
0064 //____________________________________________________________________________//
0065 
0066 } // namespace tt_detail
0067 } // namespace test_tools
0068 } // namespace boost
0069 
0070 #include <boost/test/detail/enable_warnings.hpp>
0071 
0072 #endif // BOOST_TEST_NO_OLD_TOOLS
0073 
0074 #endif // BOOST_TEST_TOOLS_DETAIL_IT_PAIR_HPP_112812GER