Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:00

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033)
0008 #define FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/support/iterator_base.hpp>
0012 #include <boost/fusion/support/category_of.hpp>
0013 #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
0014 #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
0015 #include <boost/fusion/view/transform_view/detail/deref_impl.hpp>
0016 #include <boost/fusion/view/transform_view/detail/next_impl.hpp>
0017 #include <boost/fusion/view/transform_view/detail/prior_impl.hpp>
0018 #include <boost/fusion/view/transform_view/detail/value_of_impl.hpp>
0019 #include <boost/fusion/view/transform_view/detail/advance_impl.hpp>
0020 #include <boost/fusion/view/transform_view/detail/distance_impl.hpp>
0021 #include <boost/fusion/view/transform_view/detail/equal_to_impl.hpp>
0022 #include <boost/fusion/view/transform_view/detail/key_of_impl.hpp>
0023 #include <boost/fusion/view/transform_view/detail/value_of_data_impl.hpp>
0024 #include <boost/fusion/view/transform_view/detail/deref_data_impl.hpp>
0025 
0026 #ifdef _MSC_VER
0027 #  pragma warning(push)
0028 #  pragma warning(disable: 4512) // assignment operator could not be generated.
0029 #endif
0030 
0031 namespace boost { namespace fusion
0032 {
0033     // Unary Version
0034     struct transform_view_iterator_tag;
0035 
0036     template <typename First, typename F>
0037     struct transform_view_iterator
0038         : iterator_base<transform_view_iterator<First, F> >
0039     {
0040         typedef transform_view_iterator_tag fusion_tag;
0041         typedef convert_iterator<First> converter;
0042         typedef typename converter::type first_type;
0043         typedef typename traits::category_of<first_type>::type category;
0044         typedef F transform_type;
0045 
0046         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0047         transform_view_iterator(First const& in_first, F const& in_f)
0048             : first(converter::call(in_first)), f(in_f) {}
0049 
0050         first_type first;
0051         transform_type f;
0052     };
0053 
0054     // Binary Version
0055     struct transform_view_iterator2_tag;
0056 
0057     template <typename First1, typename First2, typename F>
0058     struct transform_view_iterator2
0059         : iterator_base<transform_view_iterator2<First1, First2, F> >
0060     {
0061         typedef transform_view_iterator2_tag fusion_tag;
0062         typedef convert_iterator<First1> converter1;
0063         typedef convert_iterator<First2> converter2;
0064         typedef typename converter1::type first1_type;
0065         typedef typename converter2::type first2_type;
0066         typedef typename traits::category_of<first1_type>::type category;
0067         typedef F transform_type;
0068 
0069         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0070         transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f)
0071             : first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {}
0072 
0073         first1_type first1;
0074         first2_type first2;
0075         transform_type f;
0076     };
0077 }}
0078 
0079 #ifdef _MSC_VER
0080 #  pragma warning(pop)
0081 #endif
0082 
0083 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
0084 namespace std
0085 {
0086     template <typename First, typename F>
0087     struct iterator_traits< ::boost::fusion::transform_view_iterator<First, F> >
0088     { };
0089     template <typename First1, typename First2, typename F>
0090     struct iterator_traits< ::boost::fusion::transform_view_iterator2<First1, First2, F> >
0091     { };
0092 }
0093 #endif
0094 
0095 #endif
0096