creating branch for fusion 2.1

[SVN r40232]
This commit is contained in:
Joel de Guzman
2007-10-20 23:59:59 +00:00
parent c3fec7efe6
commit fc57a566cb
476 changed files with 25709 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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(FUSION_ADVANCE_IMPL_13122005_1906)
#define FUSION_ADVANCE_IMPL_13122005_1906
#include <boost/fusion/iterator/advance.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
template<typename First, typename F>
struct transform_view_iterator;
template <typename First1, typename First2, typename F>
struct transform_view_iterator2;
namespace extension
{
template<typename Tag>
struct advance_impl;
// Unary Version
template<>
struct advance_impl<transform_view_iterator_tag>
{
template<typename Iterator, typename Dist>
struct apply
{
typedef typename Iterator::first_type first_type;
typedef typename result_of::advance<first_type, Dist>::type advanced_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator<advanced_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(boost::fusion::advance<Dist>(i.first), i.f);
}
};
};
// Binary Version
template<>
struct advance_impl<transform_view_iterator2_tag>
{
template<typename Iterator, typename Dist>
struct apply
{
typedef typename Iterator::first1_type first1_type;
typedef typename Iterator::first2_type first2_type;
typedef typename result_of::advance<first1_type, Dist>::type advanced1_type;
typedef typename result_of::advance<first2_type, Dist>::type advanced2_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator2<advanced1_type, advanced2_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(
boost::fusion::advance<Dist>(i.first1)
, boost::fusion::advance<Dist>(i.first2), i.f);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2007 Dan Marsden
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_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936)
#define BOOST_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion
{
struct void_;
namespace detail
{
template <typename F>
struct apply_transform_result
{
template <typename T0, typename T1 = void_>
struct apply
: boost::result_of<F(T0, T1)>
{};
template <typename T0>
struct apply<T0, void_>
: boost::result_of<F(T0)>
{};
};
}
}}
#endif

View File

@@ -0,0 +1,63 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_FUSION_AT_IMPL_20061029_1946)
#define BOOST_FUSION_AT_IMPL_20061029_1946
#include <boost/mpl/apply.hpp>
#include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
namespace boost { namespace fusion {
struct transform_view_tag;
struct transform_view2_tag;
namespace extension
{
template<typename Tag>
struct at_impl;
template<>
struct at_impl<transform_view_tag>
{
template<typename Seq, typename N>
struct apply
{
typedef typename Seq::transform_type F;
typedef detail::apply_transform_result<F> transform_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence_type, N>::type value_type;
typedef typename mpl::apply<transform_type, value_type>::type type;
static type call(Seq& seq)
{
return seq.f(boost::fusion::at<N>(seq.seq));
}
};
};
template<>
struct at_impl<transform_view2_tag>
{
template<typename Seq, typename N>
struct apply
{
typedef typename Seq::transform_type F;
typedef detail::apply_transform_result<F> transform_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence1_type, N>::type value1_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence2_type, N>::type value2_type;
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
static type call(Seq& seq)
{
return seq.f(boost::fusion::at<N>(seq.seq1), boost::fusion::at<N>(seq.seq2));
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,68 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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(FUSION_BEGIN_IMPL_07162005_1031)
#define FUSION_BEGIN_IMPL_07162005_1031
#include <boost/fusion/view/transform_view/transform_view_fwd.hpp>
namespace boost { namespace fusion
{
template <typename First, typename F>
struct transform_view_iterator;
template <typename First1, typename First2, typename F>
struct transform_view_iterator2;
namespace extension
{
template <typename Tag>
struct begin_impl;
// Unary Version
template <>
struct begin_impl<transform_view_tag>
{
template <typename Sequence>
struct apply
{
typedef typename Sequence::first_type first_type;
typedef typename Sequence::transform_type transform_type;
typedef transform_view_iterator<first_type, transform_type> type;
static type
call(Sequence& s)
{
return type(s.first(), s.f);
}
};
};
// Binary Version
template <>
struct begin_impl<transform_view2_tag>
{
template <typename Sequence>
struct apply
{
typedef typename Sequence::first1_type first1_type;
typedef typename Sequence::first2_type first2_type;
typedef typename Sequence::transform_type transform_type;
typedef transform_view_iterator2<first1_type, first2_type, transform_type> type;
static type
call(Sequence& s)
{
return type(s.first1(), s.first2(), s.f);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,76 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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(FUSION_DEREF_IMPL_07162005_1026)
#define FUSION_DEREF_IMPL_07162005_1026
#include <boost/mpl/apply.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template <typename Tag>
struct deref_impl;
// Unary Version
template <>
struct deref_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::deref<typename Iterator::first_type>::type
value_type;
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
typedef typename mpl::apply<transform_type, value_type>::type type;
static type
call(Iterator const& i)
{
return i.f(*i.first);
}
};
};
// Binary Version
template <>
struct deref_impl<transform_view_iterator2_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::deref<typename Iterator::first1_type>::type
value1_type;
typedef typename
result_of::deref<typename Iterator::first2_type>::type
value2_type;
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
static type
call(Iterator const& i)
{
return i.f(*i.first1, *i.first2);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,59 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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(FUSION_DISTANCE_IMPL_13122005_2139)
#define FUSION_DISTANCE_IMPL_13122005_2139
#include <boost/fusion/iterator/distance.hpp>
namespace boost { namespace fusion {
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct distance_impl;
// Unary Version
template<>
struct distance_impl<transform_view_iterator_tag>
{
template<typename First, typename Last>
struct apply
: result_of::distance<typename First::first_type, typename Last::first_type>
{
static
typename result_of::distance<typename First::first_type, typename Last::first_type>::type
call(First const& first, Last const& last)
{
return boost::fusion::distance(first.first, last.first);
}
};
};
// Binary Version
template<>
struct distance_impl<transform_view_iterator2_tag>
{
template<typename First, typename Last>
struct apply
: result_of::distance<typename First::first1_type, typename Last::first1_type>
{
static
typename result_of::distance<typename First::first1_type, typename Last::first1_type>::type
call(First const& first, Last const& last)
{
return boost::fusion::distance(first.first1, last.first1);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,68 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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(FUSION_END_IMPL_07162005_1028)
#define FUSION_END_IMPL_07162005_1028
#include <boost/fusion/view/transform_view/transform_view_fwd.hpp>
namespace boost { namespace fusion
{
template <typename First, typename F>
struct transform_view_iterator;
template <typename First1, typename First2, typename F>
struct transform_view_iterator2;
namespace extension
{
template <typename Tag>
struct end_impl;
// Unary Version
template <>
struct end_impl<transform_view_tag>
{
template <typename Sequence>
struct apply
{
typedef typename Sequence::last_type last_type;
typedef typename Sequence::transform_type transform_type;
typedef transform_view_iterator<last_type, transform_type> type;
static type
call(Sequence& s)
{
return type(s.last(), s.f);
}
};
};
// Binary Version
template <>
struct end_impl<transform_view2_tag>
{
template <typename Sequence>
struct apply
{
typedef typename Sequence::last1_type last1_type;
typedef typename Sequence::last2_type last2_type;
typedef typename Sequence::transform_type transform_type;
typedef transform_view_iterator2<last1_type, last2_type, transform_type> type;
static type
call(Sequence& s)
{
return type(s.last1(), s.last2(), s.f);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,42 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957)
#define BOOST_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957
#include <boost/fusion/iterator/equal_to.hpp>
namespace boost { namespace fusion {
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct equal_to_impl;
template<>
struct equal_to_impl<transform_view_iterator_tag>
{
template<typename It1, typename It2>
struct apply
: result_of::equal_to<typename It1::first_type, typename It2::first_type>
{};
};
template<>
struct equal_to_impl<transform_view_iterator2_tag>
{
template<typename It1, typename It2>
struct apply
: result_of::equal_to<typename It1::first1_type, typename It2::first1_type>
{};
};
}
}}
#endif

View File

@@ -0,0 +1,74 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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(FUSION_NEXT_IMPL_07162005_1029)
#define FUSION_NEXT_IMPL_07162005_1029
#include <boost/fusion/iterator/next.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
template<typename First, typename F>
struct transform_view_iterator;
template <typename First1, typename First2, typename F>
struct transform_view_iterator2;
namespace extension
{
template <typename Tag>
struct next_impl;
// Unary Version
template <>
struct next_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename Iterator::first_type first_type;
typedef typename result_of::next<first_type>::type next_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator<next_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(fusion::next(i.first), i.f);
}
};
};
// Binary Version
template <>
struct next_impl<transform_view_iterator2_tag>
{
template <typename Iterator>
struct apply
{
typedef typename Iterator::first1_type first1_type;
typedef typename Iterator::first2_type first2_type;
typedef typename result_of::next<first1_type>::type next1_type;
typedef typename result_of::next<first2_type>::type next2_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator2<next1_type, next2_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(fusion::next(i.first1), fusion::next(i.first2), i.f);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,73 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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(FUSION_PREV_IMPL_13122005_2110)
#define FUSION_PREV_IMPL_13122005_2110
#include <boost/fusion/iterator/prior.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
template<typename First, typename F>
struct transform_view_iterator;
template <typename First1, typename First2, typename F>
struct transform_view_iterator2;
namespace extension
{
template<typename Tag>
struct prior_impl;
// Unary Version
template<>
struct prior_impl<transform_view_iterator_tag>
{
template<typename Iterator>
struct apply
{
typedef typename Iterator::first_type first_type;
typedef typename result_of::prior<first_type>::type prior_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator<prior_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(fusion::prior(i.first), i.f);
}
};
};
// Binary Version
template<>
struct prior_impl<transform_view_iterator2_tag>
{
template<typename Iterator>
struct apply
{
typedef typename Iterator::first1_type first1_type;
typedef typename Iterator::first2_type first2_type;
typedef typename result_of::prior<first1_type>::type prior1_type;
typedef typename result_of::prior<first2_type>::type prior2_type;
typedef typename Iterator::transform_type transform_type;
typedef transform_view_iterator2<prior1_type, prior2_type, transform_type> type;
static type
call(Iterator const& i)
{
return type(fusion::prior(i.first1), fusion::prior(i.first2), i.f);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,53 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_FUSION_VALUE_AT_IMPL_20061101_0745)
#define BOOST_FUSION_VALUE_AT_IMPL_20061101_0745
#include <boost/mpl/apply.hpp>
#include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
namespace boost { namespace fusion {
struct transform_view_tag;
struct transform_view2_tag;
namespace extension
{
template<typename Tag>
struct value_at_impl;
template<>
struct value_at_impl<transform_view_tag>
{
template<typename Seq, typename N>
struct apply
{
typedef typename Seq::transform_type F;
typedef detail::apply_transform_result<F> transform_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence_type, N>::type value_type;
typedef typename mpl::apply<transform_type, value_type>::type type;
};
};
template<>
struct value_at_impl<transform_view2_tag>
{
template<typename Seq, typename N>
struct apply
{
typedef typename Seq::transform_type F;
typedef detail::apply_transform_result<F> transform_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence1_type, N>::type value1_type;
typedef typename boost::fusion::result_of::at<typename Seq::sequence2_type, N>::type value2_type;
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,63 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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(FUSION_VALUE_OF_IMPL_07162005_1030)
#define FUSION_VALUE_OF_IMPL_07162005_1030
#include <boost/mpl/apply.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template <typename Tag>
struct value_of_impl;
// Unary Version
template <>
struct value_of_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::value_of<typename Iterator::first_type>::type
value_type;
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
typedef typename mpl::apply<transform_type, value_type>::type type;
};
};
// Binary Version
template <>
struct value_of_impl<transform_view_iterator2_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::value_of<typename Iterator::first1_type>::type
value1_type;
typedef typename
result_of::value_of<typename Iterator::first2_type>::type
value2_type;
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
};
};
}
}}
#endif