title: alloca() with VLAs and C++
body: <p>The only <code>alloca()</code> replacement for C++ I have found on the Internet looks something like this:</p>
  
  <pre><code>template &lt;typename F&gt;
  void alloca_(::std::size_t const n, F&amp;&amp; f) noexcept(noexcept(f({})))
  {
    alignas(::std::max_align_t) char p[n];
  
    f(p);
  }
  </code></pre>
  
  <p>But, obviously, this is not the <code>alloca()</code> we know and love, it is not a function, nor a macro. Can an <code>alloca()</code> implementation that resembles the <code>alloca()</code> function call semantics more closely, be written? Perhaps as a macro? Whether macro or function, it should allocate space from the stack, not the heap.</p>