title: Using mpl::transform to generate a new sequence
body: <p>I am trying to generate some generic configuration handling code that maps indexes to types, using a <code>fusion::map</code> with an internal format as follows:</p>
  
  <pre><code>fusion::pair&lt; mpl::int_&lt; VALUE &gt;, type &gt;;
  </code></pre>
  
  <p>To simplify generation of the map I have the following code:</p>
  
  <pre><code>#include &lt;boost/fusion/sequence.hpp&gt;
  #include &lt;boost/fusion/container.hpp&gt;
  #include &lt;boost/fusion/algorithm.hpp&gt;
  
  #include &lt;boost/mpl/int.hpp&gt;
  #include &lt;boost/mpl/vector.hpp&gt;
  #include &lt;boost/mpl/map.hpp&gt;
  #include &lt;boost/type_traits/is_const.hpp&gt;
  #include &lt;boost/type_traits/is_reference.hpp&gt;
  #include &lt;boost/mpl/for_each.hpp&gt;
  #include &lt;boost/mpl/placeholders.hpp&gt;
  
  #include &lt;typeinfo&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  /// create a fusion map of all parameter data
  namespace fusion = boost::fusion;
  namespace mpl = boost::mpl;
  
  template &lt; unsigned Idx, typename T &gt;
  struct config_param
  {
      typedef mpl::int_&lt; Idx &gt; index_value;
      typedef T value_type;
  };
  
  template&lt; class T &gt;
  struct to_fusion_pair
  {
      typedef fusion::pair&lt; typename T::index_value
                          , typename T::value_type &gt; type;
  };
  
  typedef mpl::vector&lt; config_param&lt; 10, unsigned &gt;
                     , config_param&lt; 20, std::string &gt;
                     , config_param&lt; 30, bool &gt;
                     , config_param&lt; 40, long &gt;
                     , config_param&lt; 50, std::string &gt;
                     &gt; MySequence;
  
  typedef mpl::transform&lt; MySequence, to_fusion_pair&lt; mpl::_1 &gt; &gt;::type ConvertedSeq;
  </code></pre>
  
  <p>This compiles and produces the expected results, unfortunately if I try to wrap the call  to transform, I get a large number of errors. i.e:</p>
  
  <pre><code>template&lt; class Seq &gt;
  struct to_vector_of_fusion_pair
  {
      typedef mpl::transform&lt; Seq, to_fusion_pair&lt; mpl::_1 &gt; &gt;::type type;
  };
  
  typedef to_vector_of_fusion_pair&lt;MySequence&gt;::type ConvertedSeq2;
  </code></pre>
  
  <p>The compiler errors are as follows:</p>
  
  <pre><code>fusion-db.cpp:40: error: type boost::mpl::transform&lt;Seq, to_fusion_pair&lt;mpl_::arg&lt;1&gt; &gt;, mpl_::na, mpl_::na&gt; is not derived from type to_vector_of_fusion_pair&lt;Seq&gt;â
  fusion-db.cpp:40: error: expected ; before type
  </code></pre>
  
  <p>What is wrong with my <code>to_vector_of_fusion_pair</code> structure that makes it incompatible with <code>mpl::transform</code>?</p>