News for hackers. Stuff that matters.
Re:Streams – Lazy evaluation in C++14 by srean on Monday June 23, 2014 @06:38PM (#7935195)
Apologies, I did not see your question in time. Note that valarray is just a standard API, an implementer can write it as they wish. That said, these kinds of optimizations were indeed a motivation for creating valarray. Standard libraries do use exactly these optimizations in valarray (with some SIMD vectorization thrown in as well). You can also take a look at pixelglow's implementation, he has a comment downstream. It is pity that no one in the standards committee took ownership of valarray and it was included in a semi broken state.

There are no comments on this comment yet.