Heap allocation for std::array Languages

Heap allocation for std::array

According to this question std::array is allocated on the stack. However when using it together with Valgrind it shows me a heap allocation, even for elements which are allocated on the stack. Is this a false positive or real?
Read More
How to use Array.push and return the pushed item? Languages

How to use Array.push and return the pushed item?

I am calling return someArr[someArr.push(newItem)-1]; and it does pretty what it should.Wondering is there a syntactic "sugar" for that extremely common operation? I wonder because returned new length is indeed more rarely needed, than actual constructed object (which caller definetely may want to polulate). Or is that made because it...
Read More