title: aligned_storage and strict aliasing
body: <p>I'm currently using aligned_storage to implement an 'Optional' type similar to that of boost::optional. To accomplish this I have a class member like so:</p>
  
  <pre><code>typename std::aligned_storage&lt;sizeof(T), std::alignment_of&lt;T&gt;::value&gt;::type t_;
  </code></pre>
  
  <p>I use placement new to create the object, however I don't store the pointer returned anywhere. Instead, I access the underlying type of the object in all my member functions like this (obviously with checks to ensure the object is valid via a boolean flag also stored in my Optional type):</p>
  
  <pre><code>T const* operator-&gt;() const {
      return static_cast&lt;T const*&gt;(static_cast&lt;void const*&gt;(&amp;t_));
  }
  </code></pre>
  
  <p>My question is whether this is safe. My understanding is that my usage of placement new changes the 'dynamic type' of the object, and as long as I keep accessing the memory using that type I'll be okay. However I'm not clear on whether I have to hold the pointer returned from the placement new or whether I'm allowed to just cast to the underlying type whenever I need to access it. I have read section 3.10 of the C++11 standard, however I'm not fluent enough in standardese to be sure.</p>
  
  <p>If possible, I would feel better if you could give reference to the standard in your answer (it helps me sleep at night :P).</p>