[Boost-bugs] [Boost C++ Libraries] #7569: Compile Error using BOOST_FUSION_DEFINE_STRUCT_INLINE with VC10 and GCC <4.5

Subject: [Boost-bugs] [Boost C++ Libraries] #7569: Compile Error using BOOST_FUSION_DEFINE_STRUCT_INLINE with VC10 and GCC <4.5
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-25 06:46:03


#7569: Compile Error using BOOST_FUSION_DEFINE_STRUCT_INLINE with VC10 and GCC
<4.5
---------------------------------+------------------------------------------
 Reporter: oswin.krause@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: fusion
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 As laid out on the mailing list, because of too much class nesting, a few
 compilers won't get the macro to work with partial template spcialisations
 of the nested classes.

 a work around is instead of doing something like this (for example in
 iterator::deref):


 {{{
 //using (A1, a1)(A2, a2)...(AN, an) as struct arguments
 typedef A1 t1_type;
 typedef A2 t2_type;
 ...
 t1_type& t1;//linked to a1
 t2_type& t2;//linked to a2
 ...

 template<int>
 struct deref{};

 template<>
 struct deref<1>{
     typedef t1_type& type;
     type call(Sequence& seq){
         return seq.t1;
     }
 };
 }}}


 use a fusion vector to get rid of the partial template specialisation


 {{{
 typedef boost::fusion::vector<A1&,A2&,...AN&> t_seq;
 t_seq t;//tied to a1...an
 template<int N>
 struct deref{
     typedef result_of::at_c<t_seq,N> type;
     type call(Sequence& seq){
         return at_c<N>(seq.t);
     }
 };
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7569>
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:11 UTC