Refactored constexpr function to please GCC 4.6