forked from boostorg/fusion
branch for creating branch for fusion 2.1
[SVN r40237]
This commit is contained in:
40
include/boost/fusion/adapted/mpl/detail/at_impl.hpp
Normal file
40
include/boost/fusion/adapted/mpl/detail/at_impl.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
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_31122005_1642)
|
||||
#define BOOST_FUSION_AT_IMPL_31122005_1642
|
||||
|
||||
#include <boost/mpl/at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct at_impl;
|
||||
|
||||
template <>
|
||||
struct at_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::at<Sequence, N>::type type;
|
||||
|
||||
static type
|
||||
call(Sequence)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
45
include/boost/fusion/adapted/mpl/detail/begin_impl.hpp
Normal file
45
include/boost/fusion/adapted/mpl/detail/begin_impl.hpp
Normal file
@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
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_BEGIN_IMPL_31122005_1209)
|
||||
#define BOOST_FUSION_BEGIN_IMPL_31122005_1209
|
||||
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/mpl/begin.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::begin<
|
||||
typename remove_const<Sequence>::type
|
||||
>::type iterator;
|
||||
typedef mpl_iterator<iterator> type;
|
||||
|
||||
static type
|
||||
call(Sequence)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
54
include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp
Normal file
54
include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*=============================================================================
|
||||
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_CATEGORY_OF_IMPL_20060217_2141)
|
||||
#define BOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141
|
||||
|
||||
#include <boost/fusion/support/detail/mpl_iterator_category.hpp>
|
||||
#include <boost/mpl/begin_end.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
struct mpl_sequence_category_of
|
||||
{
|
||||
// assumes T is an mpl sequence
|
||||
// there should be no way this will ever be
|
||||
// called where T is an mpl iterator
|
||||
|
||||
BOOST_STATIC_ASSERT(mpl::is_sequence<T>::value);
|
||||
typedef typename
|
||||
mpl_iterator_category<
|
||||
typename mpl::begin<T>::type::category
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct category_of_impl;
|
||||
|
||||
template<>
|
||||
struct category_of_impl<mpl_sequence_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply
|
||||
: detail::mpl_sequence_category_of<T>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
28
include/boost/fusion/adapted/mpl/detail/empty_impl.hpp
Normal file
28
include/boost/fusion/adapted/mpl/detail/empty_impl.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
/*=============================================================================
|
||||
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_EMPTY_IMPL_31122005_1554)
|
||||
#define BOOST_FUSION_EMPTY_IMPL_31122005_1554
|
||||
|
||||
#include <boost/mpl/empty.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <>
|
||||
struct empty_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply : mpl::empty<Sequence> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
45
include/boost/fusion/adapted/mpl/detail/end_impl.hpp
Normal file
45
include/boost/fusion/adapted/mpl/detail/end_impl.hpp
Normal file
@ -0,0 +1,45 @@
|
||||
/*=============================================================================
|
||||
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_END_IMPL_31122005_1237)
|
||||
#define BOOST_FUSION_END_IMPL_31122005_1237
|
||||
|
||||
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
|
||||
#include <boost/mpl/end.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::end<
|
||||
typename remove_const<Sequence>::type
|
||||
>::type iterator;
|
||||
typedef mpl_iterator<iterator> type;
|
||||
|
||||
static type
|
||||
call(Sequence)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
31
include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp
Normal file
31
include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
/*=============================================================================
|
||||
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_HAS_KEY_IMPL_31122005_1647)
|
||||
#define BOOST_FUSION_HAS_KEY_IMPL_31122005_1647
|
||||
|
||||
#include <boost/mpl/has_key.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct has_key_impl;
|
||||
|
||||
template <>
|
||||
struct has_key_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply : mpl::has_key<Sequence, Key> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
31
include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp
Normal file
31
include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
/*=============================================================================
|
||||
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_IS_SEQUENCE_IMPL_31122005_1505)
|
||||
#define BOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_sequence_impl;
|
||||
|
||||
template<>
|
||||
struct is_sequence_impl<mpl_sequence_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::true_ {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
32
include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp
Normal file
32
include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*=============================================================================
|
||||
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_IS_VIEW_IMPL_03202006_0048)
|
||||
#define BOOST_FUSION_IS_VIEW_IMPL_03202006_0048
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_view_impl;
|
||||
|
||||
template<>
|
||||
struct is_view_impl<mpl_sequence_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::true_
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
31
include/boost/fusion/adapted/mpl/detail/size_impl.hpp
Normal file
31
include/boost/fusion/adapted/mpl/detail/size_impl.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
/*=============================================================================
|
||||
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_SIZE_IMPL_31122005_1508)
|
||||
#define BOOST_FUSION_SIZE_IMPL_31122005_1508
|
||||
|
||||
#include <boost/mpl/size.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply : mpl::size<Sequence> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
31
include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp
Normal file
31
include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
/*=============================================================================
|
||||
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_31122005_1621)
|
||||
#define BOOST_FUSION_VALUE_AT_IMPL_31122005_1621
|
||||
|
||||
#include <boost/mpl/at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<mpl_sequence_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply : mpl::at<Sequence, N> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
113
include/boost/fusion/adapted/mpl/mpl_iterator.hpp
Normal file
113
include/boost/fusion/adapted/mpl/mpl_iterator.hpp
Normal file
@ -0,0 +1,113 @@
|
||||
/*=============================================================================
|
||||
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_MPL_ITERATOR_05052005_0731)
|
||||
#define FUSION_MPL_ITERATOR_05052005_0731
|
||||
|
||||
#include <boost/fusion/support/detail/mpl_iterator_category.hpp>
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/next.hpp>
|
||||
#include <boost/mpl/prior.hpp>
|
||||
#include <boost/mpl/advance.hpp>
|
||||
#include <boost/mpl/distance.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template <typename Iterator_>
|
||||
struct mpl_iterator
|
||||
: iterator_facade<
|
||||
mpl_iterator<Iterator_>
|
||||
, typename detail::mpl_iterator_category<typename Iterator_::category>::type
|
||||
>
|
||||
{
|
||||
typedef typename remove_const<Iterator_>::type iterator_type;
|
||||
|
||||
template <typename Iterator>
|
||||
struct value_of : mpl::deref<typename Iterator::iterator_type> {};
|
||||
|
||||
template <typename Iterator>
|
||||
struct deref
|
||||
{
|
||||
typedef typename mpl::deref<
|
||||
typename Iterator::iterator_type>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct next
|
||||
{
|
||||
typedef mpl_iterator<
|
||||
typename mpl::next<typename Iterator::iterator_type>::type>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior
|
||||
{
|
||||
typedef mpl_iterator<
|
||||
typename mpl::prior<typename Iterator::iterator_type>::type>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance
|
||||
{
|
||||
typedef mpl_iterator<
|
||||
typename mpl::advance<typename Iterator::iterator_type, N>::type>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance :
|
||||
mpl::distance<
|
||||
typename I1::iterator_type
|
||||
, typename I2::iterator_type>
|
||||
{
|
||||
typedef typename
|
||||
mpl::distance<
|
||||
typename I1::iterator_type
|
||||
, typename I2::iterator_type
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(I1 const&, I2 const&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user