Static size valarray

I am looking for a static size valarray implementation.

It should be easy to implement on my own, but I need constexpr operations (sum, subtraction, etc.) and it is curiously boring / error prone, so I ask here if there is a popular implementation there.

If I have to implement this on my own, do you think expression templates are worth it?

+4
source share
1 answer

What about array C ++ 11 ?

But you must implement arithmetic yourself. Is it error prone? I do not think so. Maybe boring. What about goo 'ol' valarray from C ++ 99 ? There you already have your arithmetic, but, alas, they are not constexpr .

But you can take its implementation, wrap it around the simple specialization of array , and you have a less error-prone, exciting task; -)

I would really like to try it with expression templates. But it depends on how fast you have to get the code on the road. It is probably hard to do at first, but easier to maintain (for yourself and other wizards) in the end. And more fun.

-1
source

All Articles