title: boost variant copy semantics
body: <p>I was wondering what the copy semantics of boost variants are. I've checked the source code and it's a bit baffling to me so I was wondering, in the example code, if my <code>getVal(name)</code> function makes a copy of the underlying vector when it's returned? If so, should I change it to be a reference (&amp;) returned instead?</p>
  
  <pre><code>using Val = boost::variant&lt;std::vector&lt;int&gt;, std::vector&lt;std::string&gt;&gt;;
  
  Val getVal(std::string&amp; name) {
   return map[name];// where map is std::map&lt;std::string, Val&gt;
  }
  </code></pre>