+ Fixes Ticket #6016 using a two-level specialization such that specialization is preferred over SFINAE.

+ Removes tag_of_fallback. It's not needed anymore. The proper way is to specialize tag_of.

[SVN r74934]
This commit is contained in:
Joel de Guzman
2011-10-13 00:23:40 +00:00
parent fd82b51cec
commit 480183059e
2 changed files with 16 additions and 18 deletions

View File

@ -46,28 +46,29 @@ namespace boost { namespace fusion
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
template <typename Sequence, typename Active>
struct tag_of_impl
: mpl::if_<fusion::detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
mpl::identity<non_fusion_tag> >::type
{};
template <typename Sequence>
struct tag_of_impl<
Sequence
, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>
{
typedef typename Sequence::fusion_tag type;
};
}
namespace traits
{
template <typename Sequence, typename Active>
struct tag_of_fallback
{
typedef non_fusion_tag type;
};
template <typename Sequence, typename Active>
struct tag_of
: mpl::if_< fusion::detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
tag_of_fallback<Sequence> >::type
: boost::fusion::detail::tag_of_impl<Sequence, Active>
{};
template <typename Sequence>
struct tag_of<Sequence, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>
{
typedef typename Sequence::fusion_tag type;
};
}
namespace detail

View File

@ -12,9 +12,6 @@ namespace boost { namespace fusion
{
namespace traits
{
template <typename Sequence, typename Active = void>
struct tag_of_fallback;
template<typename T, typename Active = void>
struct tag_of;
}