Move is_native_fusion_sequence to detail

in order to reuse it in is_mpl_sequence
This commit is contained in:
Kohei Takahashi
2018-03-14 14:53:30 +09:00
parent 2aea153be0
commit d8f608c8f1
3 changed files with 31 additions and 15 deletions

View File

@ -9,19 +9,17 @@
#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/detail/is_native_fusion_sequence.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename T>
struct is_mpl_sequence
: mpl::and_<
mpl::not_<mpl::and_<is_complete<T>, is_convertible<T, from_sequence_convertible_type> > >
mpl::not_<is_native_fusion_sequence<T> >
, mpl::is_sequence<T> >
{};
}}}

View File

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2018 Kohei Takahashi
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)
==============================================================================*/
#ifndef BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#define BOOST_FUSION_IS_NATIVE_FUSION_SEQUENCE
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/mpl/and.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Sequence>
struct is_native_fusion_sequence
: mpl::and_<
is_complete<Sequence>
, is_convertible<Sequence, detail::from_sequence_convertible_type>
>
{};
}}}
#endif

View File

@ -10,13 +10,10 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/tag_of.hpp>
#include <boost/mpl/and.hpp>
#include <boost/fusion/support/detail/is_native_fusion_sequence.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_complete.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace fusion
{
@ -69,13 +66,7 @@ namespace boost { namespace fusion
>
{};
template <typename Sequence, typename Enable = void>
struct is_native_fusion_sequence
: mpl::and_<
is_complete<Sequence>,
is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
>
{};
using detail::is_native_fusion_sequence;
}
}}