title: How to determine if a boost::variant variable is empty?
body: <p>I have defined a boost::variant var like this:</p>
  
  <pre><code>boost::variant&lt;boost::blank, bool, int&gt; foo;
  </code></pre>
  
  <p>This variable, when instantiated but not initialized, has a value of type <code>boost::blank</code>, because <code>boost::blank</code> is the first type passed to the templated boost::variant.</p>
  
  <p>At some point, I want to know if <code>foo</code> has been initialized. I've tried this, but with no good results:</p>
  
  <pre><code>if (foo) //doesn't compile
  if (foo != boost::blank()) //doesn't compile
  if (!(foo == boost::blank())) //doesn't compile
  </code></pre>
  
  <p>I think it's worth noticing that, when <code>foo</code> has been initialized (eg., <code>foo = true</code>), it can be "reset" by doing <code>foo = boost::blank();</code>.</p>
  
  <p>How can I check if <code>foo</code> has been initialized, ie, it has a different type than <code>boost::blank</code>?</p>