Boost C++ Libraries: Ticket #10027: Allow template parameters with types rather than hardcode typename in BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE (and friends) https://svn.boost.org/trac10/ticket/10027 <p> Right now, the macro <code>BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</code> creates </p> <pre class="wiki">template&lt;typename A, typename B&gt; struct MyStruct { ... }; </pre><p> from </p> <pre class="wiki">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( (A)(B), MyStruct, (A, foo) (B, bar) ) </pre><p> But I want to put the class <code>template&lt;int DIM&gt; class Vector</code> into a Boost Fusion Struct. So the struct should allow template parameters that are not typenames. I would like to be able to write the following: </p> <pre class="wiki">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( (int DIM)(typename B), MyStruct, (Vector&lt;DIM&gt;, foo) (B, bar) ) // the above becomes // template&lt;int DIM, typename B&gt; // struct MyStruct { ... }; MyStruct&lt;3, double&gt; struct; </pre><p> This does not currently work. The following is a working (but cumbersome) workaround (using C++11): </p> <pre class="wiki">BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( (DIM)(B), MyStructImpl, (Vector&lt;DIM::value&gt;, foo) (B, bar) ) template&lt;int DIM&gt; using MyStruct = MyStructImpl&lt;boost::mpl::int_&lt;DIM&gt;&gt;; MyStruct&lt;3, double&gt; struct; </pre><p> Maybe for backwards compatibility my proposed version of <code>BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE</code> where template parameters are declared as <code>(int DIM)(typename B)</code> should be named <code>BOOST_FUSION_DEFINE_FLEXIBLE_TPL_STRUCT_INLINE</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10027 Trac 1.4.3