title: Convert a std::vector of a boost::variant type
body: <p>How might I implement the function below to convert from vector of <code>Value</code> to a <code>Container</code>? I wish to assert if not all the members of <code>values</code> are of the same type, i.e. if the vector contains a mix of strings and ints. This is because the function's return value is either a <code>std::vector&lt;int&gt;</code> or a <code>std::vector&lt;std::string&gt;</code>.</p>
  
  <pre><code>typedef boost::variant&lt;int, std::string&gt; Value;
  typedef boost::variant&lt;std::vector&lt;int&gt;, std::vector&lt;std::string&gt; &gt; Container;
  
  Container valuesToContainer(const std::vector&lt;Value&gt;&amp; values) 
  {
      return Container();
  }
  </code></pre>