c++1z - alloca() with VLAs and C++ -


the alloca() replacement c++ have found on internet looks this:

template <typename f> void alloca_(::std::size_t const n, f&& f) noexcept(noexcept(f({}))) {   alignas(::std::max_align_t) char p[n];    f(p); } 

but, obviously, not alloca() know , love, not function, nor macro. can alloca() implementation resembles alloca() function call semantics more closely, written? perhaps macro? whether macro or function, should allocate space stack, not heap.


Comments

Popular posts from this blog

Android volley - avoid multiple requests of the same kind to the server? -

magento2 - Magento 2 admin grid add filter to collection -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -