|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74934 - trunk/boost/fusion/support
From: joel_at_[hidden]
Date: 2011-10-12 20:23:41
Author: djowel
Date: 2011-10-12 20:23:40 EDT (Wed, 12 Oct 2011)
New Revision: 74934
URL: http://svn.boost.org/trac/boost/changeset/74934
Log:
+ 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.
Text files modified:
trunk/boost/fusion/support/tag_of.hpp | 27 ++++++++++++++-------------
trunk/boost/fusion/support/tag_of_fwd.hpp | 3 ---
2 files changed, 14 insertions(+), 16 deletions(-)
Modified: trunk/boost/fusion/support/tag_of.hpp
==============================================================================
--- trunk/boost/fusion/support/tag_of.hpp (original)
+++ trunk/boost/fusion/support/tag_of.hpp 2011-10-12 20:23:40 EDT (Wed, 12 Oct 2011)
@@ -46,30 +46,31 @@
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
- }
-
- 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>,
+ struct tag_of_impl
+ : mpl::if_<fusion::detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
- tag_of_fallback<Sequence> >::type
+ mpl::identity<non_fusion_tag> >::type
{};
template <typename Sequence>
- struct tag_of<Sequence, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>
+ 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
+ : boost::fusion::detail::tag_of_impl<Sequence, Active>
+ {};
+ }
+
namespace detail
{
template<typename T>
Modified: trunk/boost/fusion/support/tag_of_fwd.hpp
==============================================================================
--- trunk/boost/fusion/support/tag_of_fwd.hpp (original)
+++ trunk/boost/fusion/support/tag_of_fwd.hpp 2011-10-12 20:23:40 EDT (Wed, 12 Oct 2011)
@@ -12,9 +12,6 @@
{
namespace traits
{
- template <typename Sequence, typename Active = void>
- struct tag_of_fallback;
-
template<typename T, typename Active = void>
struct tag_of;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk