Tweaks and addition of main header mpl.hpp to make using MPL and Fusion easy

[SVN r35142]
This commit is contained in:
Joel de Guzman 2006-09-17 13:05:25 +00:00
parent eb324cc029
commit 147abb8cdd
3 changed files with 36 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/advance_fwd.hpp>
#include <boost/mpl/distance_fwd.hpp>
@ -23,6 +24,7 @@ namespace boost { namespace mpl
struct fusion_iterator
{
typedef typename fusion::result_of::value_of<Iterator>::type type;
typedef typename fusion::traits::category_of<Iterator>::type category;
typedef Iterator iterator;
};

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2001-2006 Joel de Guzman
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)
==============================================================================*/
#if !defined(FUSION_MPL_09172006_2049)
#define FUSION_MPL_09172006_2049
// The fusion <--> MPL link headers
#include <boost/fusion/iterator/mpl.hpp>
#include <boost/fusion/sequence/intrinsic/mpl.hpp>
#include <boost/fusion/sequence/adapted/mpl.hpp>
#endif

View File

@ -44,6 +44,24 @@ namespace boost { namespace fusion { namespace detail
{
typedef random_access_traversal_tag type;
};
template <>
struct mpl_iterator_category<forward_traversal_tag>
{
typedef forward_traversal_tag type;
};
template <>
struct mpl_iterator_category<bidirectional_traversal_tag>
{
typedef bidirectional_traversal_tag type;
};
template <>
struct mpl_iterator_category<random_access_traversal_tag>
{
typedef random_access_traversal_tag type;
};
}}}
#endif