Margin.h why use template in GetTotalSpaceAlong?

Hi,

So in Margin.h:l156-169 there’s a strange templated method called “GetTotalSpaceAlong”. Seems overly complex to me. Why? I probably don’t see the whole picture here & so I would like to know why it was done that way.

Thanks!