Boost C++ Libraries: Ticket #7569: Compile Error using BOOST_FUSION_DEFINE_STRUCT_INLINE with VC10 and GCC <4.5 https://svn.boost.org/trac10/ticket/7569 <p> 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. </p> <p> a work around is instead of doing something like this (for example in iterator::deref): </p> <pre class="wiki">//using (A1, a1)(A2, a2)...(AN, an) as struct arguments typedef A1 t1_type; typedef A2 t2_type; ... t1_type&amp; t1;//linked to a1 t2_type&amp; t2;//linked to a2 ... template&lt;int&gt; struct deref{}; template&lt;&gt; struct deref&lt;1&gt;{ typedef t1_type&amp; type; type call(Sequence&amp; seq){ return seq.t1; } }; </pre><p> use a fusion vector to get rid of the partial template specialisation </p> <pre class="wiki">typedef boost::fusion::vector&lt;A1&amp;,A2&amp;,...AN&amp;&gt; t_seq; t_seq t;//tied to a1...an template&lt;int N&gt; struct deref{ typedef result_of::at_c&lt;t_seq,N&gt; type; type call(Sequence&amp; seq){ return at_c&lt;N&gt;(seq.t); } }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7569 Trac 1.4.3 zeratul976@… Mon, 29 Oct 2012 00:03:57 GMT attachment set https://svn.boost.org/trac10/ticket/7569 https://svn.boost.org/trac10/ticket/7569 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">define-struct-inline-msvc-wknd.patch</span> </li> </ul> <p> Patch that implements the workaround </p> Ticket zeratul976@… Mon, 29 Oct 2012 00:04:20 GMT attachment set https://svn.boost.org/trac10/ticket/7569 https://svn.boost.org/trac10/ticket/7569 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">define-struct-inline-msvc-wknd-tests.patch</span> </li> </ul> <p> Patch to regression tests </p> Ticket zeratul976@… Mon, 29 Oct 2012 00:05:41 GMT <link>https://svn.boost.org/trac10/ticket/7569#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7569#comment:1</guid> <description> <p> I implemented the workaround and tested it with MSVC and various GCC versions, including GCC 4.2. It seems to be working. Oswin, please try it out and let me know if it works for you now. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Sun, 04 Nov 2012 00:18:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7569#comment:2 https://svn.boost.org/trac10/ticket/7569#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Patches applied. Thanks! </p> Ticket