2006-08-16 16:50:52 +00:00
|
|
|
/*=============================================================================
|
|
|
|
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_END_04052005_1141)
|
|
|
|
#define FUSION_END_04052005_1141
|
|
|
|
|
|
|
|
#include <boost/fusion/support/tag_of.hpp>
|
|
|
|
|
|
|
|
namespace boost { namespace fusion
|
|
|
|
{
|
2006-09-25 08:37:16 +00:00
|
|
|
// Special tags:
|
|
|
|
struct sequence_facade_tag;
|
2006-09-27 00:42:32 +00:00
|
|
|
struct boost_tuple_tag; // boost::tuples::tuple tag
|
2006-09-22 13:39:27 +00:00
|
|
|
struct array_tag; // boost::array tag
|
|
|
|
struct mpl_sequence_tag; // mpl sequence tag
|
|
|
|
struct std_pair_tag; // std::pair tag
|
2006-08-16 16:50:52 +00:00
|
|
|
|
|
|
|
namespace extension
|
|
|
|
{
|
|
|
|
template <typename Tag>
|
|
|
|
struct end_impl
|
|
|
|
{
|
|
|
|
template <typename Sequence>
|
|
|
|
struct apply;
|
|
|
|
};
|
2006-09-22 13:39:27 +00:00
|
|
|
|
2006-09-25 08:37:16 +00:00
|
|
|
template <>
|
|
|
|
struct end_impl<sequence_facade_tag>
|
|
|
|
{
|
|
|
|
template <typename Sequence>
|
|
|
|
struct apply : Sequence::template end<Sequence> {};
|
|
|
|
};
|
|
|
|
|
2006-09-27 00:42:32 +00:00
|
|
|
template <>
|
|
|
|
struct end_impl<boost_tuple_tag>;
|
|
|
|
|
2006-09-22 13:39:27 +00:00
|
|
|
template <>
|
|
|
|
struct end_impl<array_tag>;
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct end_impl<mpl_sequence_tag>;
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct end_impl<std_pair_tag>;
|
2006-08-16 16:50:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace result_of
|
|
|
|
{
|
|
|
|
template <typename Sequence>
|
|
|
|
struct end
|
|
|
|
: extension::end_impl<typename detail::tag_of<Sequence>::type>::
|
|
|
|
template apply<Sequence>
|
|
|
|
{};
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Sequence>
|
2006-11-09 01:48:46 +00:00
|
|
|
inline typename result_of::end<Sequence>::type const
|
2006-08-16 16:50:52 +00:00
|
|
|
end(Sequence& seq)
|
|
|
|
{
|
|
|
|
return result_of::end<Sequence>::call(seq);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Sequence>
|
2006-11-09 01:48:46 +00:00
|
|
|
inline typename result_of::end<Sequence const>::type const
|
2006-08-16 16:50:52 +00:00
|
|
|
end(Sequence const& seq)
|
|
|
|
{
|
|
|
|
return result_of::end<Sequence const>::call(seq);
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
|
|
|
|
#endif
|