?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/iterator.zip
???????
PK h!\ܧE$L L distance.hppnu �[��� // Copyright (C) 2017 Michel Morin. // // 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) #ifndef BOOST_ITERATOR_DISTANCE_HPP #define BOOST_ITERATOR_DISTANCE_HPP #include <boost/config.hpp> #include <boost/iterator/iterator_categories.hpp> #include <boost/iterator/iterator_traits.hpp> namespace boost { namespace iterators { namespace detail { template <typename SinglePassIterator> inline BOOST_CXX14_CONSTEXPR typename iterator_difference<SinglePassIterator>::type distance_impl( SinglePassIterator first , SinglePassIterator last , single_pass_traversal_tag ) { typename iterator_difference<SinglePassIterator>::type n = 0; while (first != last) { ++first; ++n; } return n; } template <typename RandomAccessIterator> inline BOOST_CXX14_CONSTEXPR typename iterator_difference<RandomAccessIterator>::type distance_impl( RandomAccessIterator first , RandomAccessIterator last , random_access_traversal_tag ) { return last - first; } } namespace distance_adl_barrier { template <typename SinglePassIterator> inline BOOST_CXX14_CONSTEXPR typename iterator_difference<SinglePassIterator>::type distance(SinglePassIterator first, SinglePassIterator last) { return detail::distance_impl( first, last, typename iterator_traversal<SinglePassIterator>::type() ); } } using namespace distance_adl_barrier; } // namespace iterators using namespace iterators::distance_adl_barrier; } // namespace boost #endif PK h!\�mI�� � function_input_iterator.hppnu �[��� // Copyright 2009 (C) Dean Michael Berris <me@deanberris.com> // Copyright 2012 (C) Google, Inc. // Copyright 2012 (C) Jeffrey Lee Hellrung, Jr. // 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) // #ifndef BOOST_FUNCTION_INPUT_ITERATOR #define BOOST_FUNCTION_INPUT_ITERATOR #include <boost/config.hpp> #include <boost/assert.hpp> #include <boost/core/addressof.hpp> #include <boost/mpl/if.hpp> #include <boost/function_types/is_function_pointer.hpp> #include <boost/function_types/result_type.hpp> #include <boost/iterator/iterator_facade.hpp> #include <boost/none.hpp> #include <boost/optional/optional.hpp> #include <boost/utility/result_of.hpp> #ifdef BOOST_RESULT_OF_USE_TR1 #include <boost/type_traits/is_function.hpp> #endif namespace boost { namespace iterators { namespace impl { // Computes the return type of an lvalue-call with an empty argument, // i.e. decltype(declval<F&>()()). F should be a nullary lvalue-callable // or function. template <class F> struct result_of_nullary_lvalue_call { typedef typename result_of< #ifdef BOOST_RESULT_OF_USE_TR1 typename mpl::if_<is_function<F>, F&, F>::type() #else F&() #endif >::type type; }; template <class Function, class Input> class function_input_iterator : public iterator_facade< function_input_iterator<Function, Input>, typename result_of_nullary_lvalue_call<Function>::type, single_pass_traversal_tag, typename result_of_nullary_lvalue_call<Function>::type const & > { public: function_input_iterator() {} function_input_iterator(Function & f_, Input state_ = Input()) : f(boost::addressof(f_)), state(state_) {} void increment() { if(value) value = none; else (*f)(); ++state; } typename result_of_nullary_lvalue_call<Function>::type const & dereference() const { return (value ? value : value = (*f)()).get(); } bool equal(function_input_iterator const & other) const { return f == other.f && state == other.state; } private: Function * f; Input state; mutable optional<typename result_of_nullary_lvalue_call<Function>::type> value; }; template <class Function, class Input> class function_pointer_input_iterator : public iterator_facade< function_pointer_input_iterator<Function, Input>, typename function_types::result_type<Function>::type, single_pass_traversal_tag, typename function_types::result_type<Function>::type const & > { public: function_pointer_input_iterator() {} function_pointer_input_iterator(Function &f_, Input state_ = Input()) : f(f_), state(state_) {} void increment() { if(value) value = none; else (*f)(); ++state; } typename function_types::result_type<Function>::type const & dereference() const { return (value ? value : value = (*f)()).get(); } bool equal(function_pointer_input_iterator const & other) const { return f == other.f && state == other.state; } private: Function f; Input state; mutable optional<typename function_types::result_type<Function>::type> value; }; } // namespace impl template <class Function, class Input> class function_input_iterator : public mpl::if_< function_types::is_function_pointer<Function>, impl::function_pointer_input_iterator<Function,Input>, impl::function_input_iterator<Function,Input> >::type { typedef typename mpl::if_< function_types::is_function_pointer<Function>, impl::function_pointer_input_iterator<Function,Input>, impl::function_input_iterator<Function,Input> >::type base_type; public: function_input_iterator(Function & f, Input i) : base_type(f, i) {} }; template <class Function, class Input> inline function_input_iterator<Function, Input> make_function_input_iterator(Function & f, Input state) { typedef function_input_iterator<Function, Input> result_t; return result_t(f, state); } template <class Function, class Input> inline function_input_iterator<Function*, Input> make_function_input_iterator(Function * f, Input state) { typedef function_input_iterator<Function*, Input> result_t; return result_t(f, state); } struct infinite { infinite & operator++() { return *this; } infinite & operator++(int) { return *this; } bool operator==(infinite &) const { return false; }; bool operator==(infinite const &) const { return false; }; }; } // namespace iterators using iterators::function_input_iterator; using iterators::make_function_input_iterator; using iterators::infinite; } // namespace boost #endif PK h!\U�� � minimum_category.hppnu �[��� // Copyright David Abrahams 2003. Use, modification and distribution is // subject to 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) #ifndef BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ # define BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ # include <boost/static_assert.hpp> # include <boost/type_traits/is_convertible.hpp> # include <boost/type_traits/is_same.hpp> # include <boost/mpl/placeholders.hpp> # include <boost/mpl/aux_/lambda_support.hpp> namespace boost { namespace iterators { namespace detail { template <bool GreaterEqual, bool LessEqual> struct minimum_category_impl; template <class T1, class T2> struct error_not_related_by_convertibility; template <> struct minimum_category_impl<true,false> { template <class T1, class T2> struct apply { typedef T2 type; }; }; template <> struct minimum_category_impl<false,true> { template <class T1, class T2> struct apply { typedef T1 type; }; }; template <> struct minimum_category_impl<true,true> { template <class T1, class T2> struct apply { BOOST_STATIC_ASSERT((is_same<T1,T2>::value)); typedef T1 type; }; }; template <> struct minimum_category_impl<false,false> { template <class T1, class T2> struct apply : error_not_related_by_convertibility<T1,T2> { }; }; } // namespace detail // // Returns the minimum category type or fails to compile // if T1 and T2 are unrelated. // template <class T1 = mpl::_1, class T2 = mpl::_2> struct minimum_category { typedef boost::iterators::detail::minimum_category_impl< ::boost::is_convertible<T1,T2>::value , ::boost::is_convertible<T2,T1>::value > outer; typedef typename outer::template apply<T1,T2> inner; typedef typename inner::type type; BOOST_MPL_AUX_LAMBDA_SUPPORT(2,minimum_category,(T1,T2)) }; template <> struct minimum_category<mpl::_1,mpl::_2> { template <class T1, class T2> struct apply : minimum_category<T1,T2> {}; BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2)) }; } // namespace iterators } // namespace boost #endif // BOOST_ITERATOR_MINIMUM_CATEGORY_HPP_INCLUDED_ PK h!\}[fu! ! transform_iterator.hppnu �[��� // (C) Copyright David Abrahams 2002. // (C) Copyright Jeremy Siek 2002. // (C) Copyright Thomas Witt 2002. // 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) #ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #include <boost/iterator/detail/enable_if.hpp> #include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_categories.hpp> #include <boost/mpl/not.hpp> #include <boost/mpl/bool.hpp> #include <boost/type_traits/function_traits.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_class.hpp> #include <boost/type_traits/is_function.hpp> #include <boost/type_traits/is_reference.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/utility/result_of.hpp> #include <iterator> #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) # include <boost/type_traits/is_base_and_derived.hpp> #endif #include <boost/iterator/detail/config_def.hpp> namespace boost { namespace iterators { template <class UnaryFunction, class Iterator, class Reference = use_default, class Value = use_default> class transform_iterator; namespace detail { // Compute the iterator_adaptor instantiation to be used for transform_iterator template <class UnaryFunc, class Iterator, class Reference, class Value> struct transform_iterator_base { private: // By default, dereferencing the iterator yields the same as // the function. typedef typename ia_dflt_help< Reference #ifdef BOOST_RESULT_OF_USE_TR1 , result_of<const UnaryFunc(typename std::iterator_traits<Iterator>::reference)> #else , result_of<const UnaryFunc&(typename std::iterator_traits<Iterator>::reference)> #endif >::type reference; // To get the default for Value: remove any reference on the // result type, but retain any constness to signal // non-writability. Note that if we adopt Thomas' suggestion // to key non-writability *only* on the Reference argument, // we'd need to strip constness here as well. typedef typename ia_dflt_help< Value , remove_reference<reference> >::type cv_value_type; public: typedef iterator_adaptor< transform_iterator<UnaryFunc, Iterator, Reference, Value> , Iterator , cv_value_type , use_default // Leave the traversal category alone , reference > type; }; } template <class UnaryFunc, class Iterator, class Reference, class Value> class transform_iterator : public boost::iterators::detail::transform_iterator_base<UnaryFunc, Iterator, Reference, Value>::type { typedef typename boost::iterators::detail::transform_iterator_base<UnaryFunc, Iterator, Reference, Value>::type super_t; friend class iterator_core_access; public: transform_iterator() { } transform_iterator(Iterator const& x, UnaryFunc f) : super_t(x), m_f(f) { } explicit transform_iterator(Iterator const& x) : super_t(x) { // Pro8 is a little too aggressive about instantiating the // body of this function. #if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // don't provide this constructor if UnaryFunc is a // function pointer type, since it will be 0. Too dangerous. BOOST_STATIC_ASSERT(is_class<UnaryFunc>::value); #endif } template < class OtherUnaryFunction , class OtherIterator , class OtherReference , class OtherValue> transform_iterator( transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue> const& t , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 #if !BOOST_WORKAROUND(BOOST_MSVC, == 1310) , typename enable_if_convertible<OtherUnaryFunction, UnaryFunc>::type* = 0 #endif ) : super_t(t.base()), m_f(t.functor()) {} UnaryFunc functor() const { return m_f; } private: typename super_t::reference dereference() const { return m_f(*this->base()); } // Probably should be the initial base class so it can be // optimized away via EBO if it is an empty class. UnaryFunc m_f; }; template <class UnaryFunc, class Iterator> inline transform_iterator<UnaryFunc, Iterator> make_transform_iterator(Iterator it, UnaryFunc fun) { return transform_iterator<UnaryFunc, Iterator>(it, fun); } // Version which allows explicit specification of the UnaryFunc // type. // // This generator is not provided if UnaryFunc is a function // pointer type, because it's too dangerous: the default-constructed // function pointer in the iterator be 0, leading to a runtime // crash. template <class UnaryFunc, class Iterator> inline typename iterators::enable_if< is_class<UnaryFunc> // We should probably find a cheaper test than is_class<> , transform_iterator<UnaryFunc, Iterator> >::type make_transform_iterator(Iterator it) { return transform_iterator<UnaryFunc, Iterator>(it, UnaryFunc()); } #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) template <class Return, class Argument, class Iterator> inline transform_iterator< Return (*)(Argument), Iterator, Return> make_transform_iterator(Iterator it, Return (*fun)(Argument)) { return transform_iterator<Return (*)(Argument), Iterator, Return>(it, fun); } #endif } // namespace iterators using iterators::transform_iterator; using iterators::make_transform_iterator; } // namespace boost #include <boost/iterator/detail/config_undef.hpp> #endif // BOOST_TRANSFORM_ITERATOR_23022003THW_HPP PK h!\���� � iterator_traits.hppnu �[��� // Copyright David Abrahams 2003. // 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) #ifndef ITERATOR_TRAITS_DWA200347_HPP # define ITERATOR_TRAITS_DWA200347_HPP # include <boost/detail/workaround.hpp> #include <iterator> namespace boost { namespace iterators { // Macro for supporting old compilers, no longer needed but kept // for backwards compatibility (it was documented). #define BOOST_ITERATOR_CATEGORY iterator_category template <class Iterator> struct iterator_value { typedef typename std::iterator_traits<Iterator>::value_type type; }; template <class Iterator> struct iterator_reference { typedef typename std::iterator_traits<Iterator>::reference type; }; template <class Iterator> struct iterator_pointer { typedef typename std::iterator_traits<Iterator>::pointer type; }; template <class Iterator> struct iterator_difference { typedef typename std::iterator_traits<Iterator>::difference_type type; }; template <class Iterator> struct iterator_category { typedef typename std::iterator_traits<Iterator>::iterator_category type; }; } // namespace iterators using iterators::iterator_value; using iterators::iterator_reference; using iterators::iterator_pointer; using iterators::iterator_difference; using iterators::iterator_category; } // namespace boost #endif // ITERATOR_TRAITS_DWA200347_HPP PK h!\y�ޡ<