title: Using std::launder to "validate" non "pointer to object" pointer value since C++17
body: <p>According to this <a href="https://stackoverflow.com/a/48062531/5632316">answer</a>, since C++17, even if a pointer has the right address and the right type dereferencing it can cause <em>undefined behaviour</em>.</p>
  
  <pre><code> alignas(int) unsigned char buffer[2*sizeof(int)];
   auto p1=new(buffer) int{};
   auto p2=new(p1+1) int{};
   *(p1+1)=10; // UB since c++17
  </code></pre>
  
  <p>The reason is that  the pointer value of <code>p1+1</code> is <a href="https://timsong-cpp.github.io/cppwp/n4659/basic.compound#3.2" rel="noreferrer"><em>a pointer past-the-end of</em></a> an object. Can this example be brought back to defined behavior using <code>std::launder</code>:</p>
  
  <pre><code> *std::launder(p1+1)=10; // still UB?  
  </code></pre>
  
  <p>Secondly, would it also be useful in this following case?</p>
  
  <pre><code>alignas(int) unsigned char buffer[3*sizeof(int)];
  auto pi = new (buffer) int{};
  auto pc = reinterpret_cast&lt;unsigned char*&gt;(pi);//not a "pointer to" an element of buffer 
                                                 //since buffer[0] and *pc 
                                                 //are not pointer interconvertible
  //pc+2*sizeof(int) would be UB
  auto pc_valid = std::launder(pc) //pc_valid is a pointer to an element of buffer
  auto pc_valid2 = pc_valid+2*sizeof(int); //not UB thanks to std::launder
  auto pi2 = new (pc_valid2) int{};
  </code></pre>