From 480183059e7be08f7d6249b99d29a7db91d3222f Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Thu, 13 Oct 2011 00:23:40 +0000 Subject: [PATCH] + 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] --- include/boost/fusion/support/tag_of.hpp | 31 +++++++++++---------- include/boost/fusion/support/tag_of_fwd.hpp | 3 -- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp index 1c5a26e5..a3fef3ba 100644 --- a/include/boost/fusion/support/tag_of.hpp +++ b/include/boost/fusion/support/tag_of.hpp @@ -46,28 +46,29 @@ namespace boost { namespace fusion namespace detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + + template + struct tag_of_impl + : mpl::if_, + mpl::identity, + mpl::identity >::type + {}; + + template + struct tag_of_impl< + Sequence + , typename boost::enable_if >::type> + { + typedef typename Sequence::fusion_tag type; + }; } namespace traits { - template - struct tag_of_fallback - { - typedef non_fusion_tag type; - }; - template struct tag_of - : mpl::if_< fusion::detail::is_mpl_sequence, - mpl::identity, - tag_of_fallback >::type + : boost::fusion::detail::tag_of_impl {}; - - template - struct tag_of >::type> - { - typedef typename Sequence::fusion_tag type; - }; } namespace detail diff --git a/include/boost/fusion/support/tag_of_fwd.hpp b/include/boost/fusion/support/tag_of_fwd.hpp index dfc0e01c..ba434d93 100644 --- a/include/boost/fusion/support/tag_of_fwd.hpp +++ b/include/boost/fusion/support/tag_of_fwd.hpp @@ -12,9 +12,6 @@ namespace boost { namespace fusion { namespace traits { - template - struct tag_of_fallback; - template struct tag_of; }