I am looking for a static-sized std::valarray implementation.
It should be easy to implement it by myself, but I need constexpr operations (sum,subtraction, etc.) and that is kinda boring/error prone to do, so I ask here if there is a popular implementation out there.
If I have to implement this by myself, do you think that expression-templates are worth in this case?
What about
arrayof C++11?But you have to implement the arithmetics yourself. Is that error-prone? I don’t think so. Boring, maybe. And what about goo’ ol’
valarrayfrom C++99? There you have your arithmetics, already — but, alas, they are notconstexpr.But you can take its implementation, wrap it around a simple
arrayspecialization and and you have a less error-prone, exciting task 😉I myself would love to try it with expression templates. But it depends how quick you have to get the code on the road. Its probably difficult to do at first, but easier to maintain (for yourself and other template magicians) in the long run. And more fun.