mirror of
https://github.com/boostorg/unordered.git
synced 2025-10-28 22:31:47 +01:00
Merged revisions 55099-55100,55132,55138,55184-55185 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r55099 | danieljames | 2009-07-22 23:37:52 +0100 (Wed, 22 Jul 2009) | 1 line Fix the insert tests when there is a small number of buckets. ........ r55100 | danieljames | 2009-07-22 23:38:08 +0100 (Wed, 22 Jul 2009) | 1 line Adjust the unordered defaults so that emplace takes more parameters and less buckets are created by default. ........ r55132 | danieljames | 2009-07-23 18:53:59 +0100 (Thu, 23 Jul 2009) | 1 line Remove the emulation of single argument C++0x std::pair constructor. ........ r55138 | danieljames | 2009-07-23 23:17:20 +0100 (Thu, 23 Jul 2009) | 1 line Try to work around an odd Visual C++ 8 bug. ........ r55184 | danieljames | 2009-07-26 19:59:33 +0100 (Sun, 26 Jul 2009) | 1 line Some extra changelog notes. ........ r55185 | danieljames | 2009-07-26 20:00:40 +0100 (Sun, 26 Jul 2009) | 1 line Update the reference documentation to mention that emplace is now emulated. ........ [SVN r55189]
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
|
|
// Copyright 2005-2009 Daniel James.
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#if !defined(BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER)
|
|
#define BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER
|
|
|
|
#include <boost/config.hpp>
|
|
#include <boost/iterator_adaptors.hpp>
|
|
|
|
namespace test
|
|
{
|
|
template <class Iterator>
|
|
struct proxy
|
|
{
|
|
typedef BOOST_DEDUCED_TYPENAME Iterator::value_type value_type;
|
|
|
|
proxy(value_type const& v) : v_(v) {}
|
|
proxy(proxy const& x) : v_(x.v_) {}
|
|
operator value_type const&() const { return v_; }
|
|
|
|
value_type v_;
|
|
};
|
|
|
|
template <class Iterator>
|
|
struct input_iterator_adaptor
|
|
: boost::iterator_adaptor<
|
|
input_iterator_adaptor<Iterator>, Iterator,
|
|
boost::use_default, std::input_iterator_tag,
|
|
proxy<Iterator> >
|
|
{
|
|
typedef boost::iterator_adaptor<
|
|
input_iterator_adaptor<Iterator>, Iterator,
|
|
boost::use_default, std::input_iterator_tag,
|
|
proxy<Iterator> > base;
|
|
|
|
explicit input_iterator_adaptor(Iterator it = Iterator())
|
|
: base(it) {}
|
|
};
|
|
|
|
template <class Iterator>
|
|
input_iterator_adaptor<Iterator> input_iterator(Iterator it)
|
|
{
|
|
return input_iterator_adaptor<Iterator>(it);
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|