fixes ambiguity in tag_of specialization

[SVN r37260]
This commit is contained in:
Tobias Schwinger
2007-03-22 19:21:29 +00:00
parent 0c3a766ee8
commit ae0b09292e
2 changed files with 7 additions and 35 deletions

View File

@ -1,29 +0,0 @@
/*=============================================================================
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_TAG_OF_31122005_1153)
#define BOOST_FUSION_TAG_OF_31122005_1153
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <boost/fusion/support/detail/is_mpl_sequence.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace traits
{
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::is_mpl_sequence<Sequence> >::type>
{
typedef mpl_sequence_tag type;
};
}
}}
#endif

View File

@ -12,7 +12,9 @@
#include <boost/fusion/support/detail/is_mpl_sequence.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <utility>
namespace boost
@ -38,6 +40,7 @@ namespace boost
namespace boost { namespace fusion
{
struct non_fusion_tag;
struct mpl_sequence_tag;
namespace detail
{
@ -48,9 +51,10 @@ namespace boost { namespace fusion
{
template <typename Sequence, typename Active>
struct tag_of
{
typedef non_fusion_tag type;
};
: mpl::if_< detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
mpl::identity<non_fusion_tag> >::type
{ };
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>
@ -73,9 +77,6 @@ namespace boost { namespace fusion
template <typename T, std::size_t N>
struct tag_of<boost::array<T, N> >;
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::is_mpl_sequence<Sequence> >::type>;
template<typename T1, typename T2>
struct tag_of<std::pair<T1, T2> >;
}