2006-10-05 01:25:32 +00:00
|
|
|
/*=============================================================================
|
|
|
|
Copyright (c) 2006 Eric Niebler
|
|
|
|
|
2007-03-02 10:44:14 +00:00
|
|
|
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)
|
2006-10-05 01:25:32 +00:00
|
|
|
==============================================================================*/
|
|
|
|
#if !defined(FUSION_IS_SEGMENTED_03202006_0015)
|
|
|
|
#define FUSION_IS_SEGMENTED_03202006_0015
|
|
|
|
|
2012-07-05 04:40:37 +00:00
|
|
|
#include <boost/mpl/bool.hpp>
|
2006-10-05 01:25:32 +00:00
|
|
|
#include <boost/fusion/support/tag_of.hpp>
|
|
|
|
|
|
|
|
namespace boost { namespace fusion
|
|
|
|
{
|
|
|
|
// Special tags:
|
|
|
|
struct sequence_facade_tag;
|
|
|
|
struct iterator_range_tag;
|
|
|
|
|
|
|
|
namespace extension
|
|
|
|
{
|
2011-08-16 23:07:51 +00:00
|
|
|
template <typename Tag>
|
2006-10-05 01:25:32 +00:00
|
|
|
struct is_segmented_impl
|
|
|
|
{
|
2011-08-16 23:07:51 +00:00
|
|
|
template <typename Sequence>
|
2006-10-05 01:25:32 +00:00
|
|
|
struct apply
|
|
|
|
: mpl::false_
|
|
|
|
{};
|
|
|
|
};
|
|
|
|
|
2011-08-16 23:07:51 +00:00
|
|
|
template <>
|
|
|
|
struct is_segmented_impl<sequence_facade_tag>
|
|
|
|
{
|
|
|
|
template <typename Sequence>
|
|
|
|
struct apply : Sequence::is_segmented {};
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2006-10-05 01:25:32 +00:00
|
|
|
struct is_segmented_impl<iterator_range_tag>;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace traits
|
|
|
|
{
|
|
|
|
template <typename Sequence>
|
|
|
|
struct is_segmented
|
2012-07-05 04:40:37 +00:00
|
|
|
: mpl::bool_<
|
|
|
|
(bool)extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
|
|
|
|
template apply<Sequence>::type::value
|
|
|
|
>
|
2006-10-05 01:25:32 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
|
|
|
|
#endif
|