[Boost-bugs] [Boost C++ Libraries] #6016: Specializing tag_of is ambiguous with having a fusion tag

Subject: [Boost-bugs] [Boost C++ Libraries] #6016: Specializing tag_of is ambiguous with having a fusion tag
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-12 17:11:29


#6016: Specializing tag_of is ambiguous with having a fusion tag
-------------------------------------+--------------------------------------
 Reporter: mgaunard | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: fusion
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 The way tag_of is implemented, having both a specialization of tag_of and
 a fusion_tag typedef is ambiguous.

 This is problematic because it can prevent redefining Proto expressions as
 other types of fusion sequences for example.

 testcase:
 {{{
 #include <boost/fusion/include/tag_of.hpp>

 struct my_tag {};

 template<class T>
 struct my_type
 {
     typedef my_tag fusion_tag;
 };

 namespace boost { namespace fusion { namespace traits
 {
     template<class T>
     struct tag_of< my_type<T> >
     {
         typedef my_tag type;
     };
 } } }

 int main()
 {
     boost::fusion::traits::tag_of<my_type<int> >::type _;
 }
 }}}

 To solve this problem, a two-level specialization system should be
 provided so that specialization is preferred over SFINAE.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6016>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC