@@ -103,7 +103,7 @@ static constexpr float float_sqrteps = vnl_math::float_sqrteps;
103103 * bit, the 64 bit or the vanilla version */
104104#define itkTemplateFloatingToIntegerMacro (name ) \
105105 template <typename TReturn, typename TInput> \
106- inline constexpr TReturn name (TInput x) \
106+ inline constexpr auto name (TInput x) \
107107 { \
108108 if constexpr (sizeof (TReturn) <= 4 ) \
109109 { \
@@ -172,7 +172,7 @@ itkTemplateFloatingToIntegerMacro(RoundHalfIntegerUp)
172172 * \sa RoundHalfIntegerUp<TReturn, TInput>()
173173 */
174174template <typename TReturn, typename TInput>
175- inline constexpr TReturn
175+ inline constexpr auto
176176Round (TInput x)
177177{
178178 return RoundHalfIntegerUp<TReturn, TInput>(x);
@@ -207,7 +207,7 @@ itkTemplateFloatingToIntegerMacro(Ceil)
207207#undef itkTemplateFloatingToIntegerMacro
208208
209209template <typename TReturn, typename TInput>
210- inline TReturn
210+ inline auto
211211CastWithRangeCheck (TInput x)
212212{
213213 itkConceptMacro (OnlyDefinedForIntegerTypes1, (itk::Concept::IsInteger<TReturn>));
@@ -793,7 +793,7 @@ GreatestPrimeFactor(T n)
793793 * "constexpr context" and a debug assert failure at run-time.
794794 */
795795template <typename TReturnType = uintmax_t >
796- constexpr TReturnType
796+ constexpr auto
797797UnsignedProduct (const uintmax_t a, const uintmax_t b) noexcept
798798{
799799 static_assert (std::is_unsigned_v<TReturnType>, " UnsignedProduct only supports unsigned return types" );
@@ -815,8 +815,8 @@ UnsignedProduct(const uintmax_t a, const uintmax_t b) noexcept
815815 * no agreed-upon value: https://en.wikipedia.org/wiki/Zero_to_the_power_of_zero
816816 */
817817template <typename TReturnType = uintmax_t >
818- constexpr TReturnType
819- UnsignedPower (const uintmax_t base, const uintmax_t exponent) noexcept
818+ constexpr auto
819+ UnsignedPower (const uintmax_t base, const uintmax_t exponent) noexcept -> TReturnType
820820{
821821 static_assert (std::is_unsigned_v<TReturnType>, " UnsignedPower only supports unsigned return types" );
822822
0 commit comments