title: How to instantiate a boost::fusion::vector member variable of a type which has no default constructor?
body: <p>I am learning boost::mpl and I have the following class -</p>
  
  <pre><code>#include &lt;string&gt;
  
  #include &lt;boost/mpl/vector.hpp&gt;
  #include &lt;boost/mpl/size.hpp&gt;
  #include &lt;boost/mpl/at.hpp&gt;
  
  #include &lt;boost/fusion/include/mpl.hpp&gt;
  #include &lt;boost/fusion/container.hpp&gt;
  
  
  using namespace boost;
  using namespace std;
  
  template&lt; typename T &gt; 
  class Demo
  {
  public:
      typedef boost::mpl::size&lt;T&gt; NumDimensions;
  
      template&lt; size_t D &gt;
      struct Dim
      {
          typedef typename boost::mpl::at_c&lt; T, D &gt;::type Type;
      };
  
      template&lt; size_t D &gt;
      typename Dim&lt;D&gt;::Type&amp; GetElement()
      {
          return fusion::at_c&lt;D&gt;(elements_);
      }
  
  private:
      typename fusion::result_of::as_vector&lt; T &gt;::type elements_;
  };
  </code></pre>
  
  <p>This works fine, as long as I use types with default constructors (or default types)</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      typedef Demo&lt; boost::mpl::vector&lt; int, std::string &gt; &gt; D1;
      D1 d;
      D1::Dim&lt;0&gt;::Type &amp;i = d.GetElement&lt;0&gt;();
  
      i = "Hello World!";
  
      cout &lt;&lt; " " &lt;&lt; i &lt;&lt; endl;
  }
  </code></pre>
  
  <p>However, if I use a type with no default constructor, it throws a compiler error because the vector initialization fails. Is there a standard way to initialize the members properly (in a constructor) without resorting to pointers/references?</p>