title: Getter for boost::variant object
body: <p>I have a getter object that returns an object of type Type, defined as follows:</p>
  
  <pre><code>typedef boost::variant&lt;int, std::string&gt; Empty;
  </code></pre>
  
  <p>It is often the case that I will have neither an int nor a string to return and will have to instead return an empty state. How do you think I return this state?</p>
  
  <p>a) typedef an Empty type and add it to the variant: <code>boost::variant&lt;int, std::string, Empty&gt;</code>.</p>
  
  <p>b) return Type()</p>
  
  <p>c) Cast an exception </p>
  
  <p>d) return a boost::shared_ptr, which points to NULL in the case of empty.</p>