I am a newbie c++ developper transitionning from Fortran. I am trying to write the most efficient possible function to compute the norm of the difference of two compile-time known size std::arrays (typically between 1 and 10, most often < 100). Of course, a simple for-loop easily does the trick, but I wonder how it compares (in terms of efficiency) to more modern style of programming, (possibly using std::accumulate, or std::inner_product ?).
Maybe a simple solution already exists in a dedicated library (like Boost or Eigen) ? I understand too little of those to make sure.
Best,