From 2a44e62be8f0fc61e5f119f0ecab6b61ea462ea5 Mon Sep 17 00:00:00 2001 From: Justus Calvin Date: Tue, 16 Apr 2024 08:46:07 -0700 Subject: [PATCH] Remove redundant ordinal function The `RangeNd::ordinal(...)` functions are redundant. They can be implemented using a single function. For cases where you want to call `RangeNd::ordinal()`, overload priority will favor the non-template function. The ordinal object is able to differentiate the different arguments. --- btas/range.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/btas/range.h b/btas/range.h index c11a215f..44bd402e 100644 --- a/btas/range.h +++ b/btas/range.h @@ -956,27 +956,13 @@ namespace btas { /// calculates the ordinal value of \c i - /// Convert an index to its ordinal. - /// \tparam Index A coordinate index type (array type) - /// \param index The index to be converted to an ordinal index - /// \return The ordinal index of \c index - /// \throw When \c index is not included in this range. - template - typename std::enable_if::value, ordinal_type>::type - ordinal(const Index& index) const { - return ordinal_(index); - } - - /// calculates the ordinal value of \c i - /// Convert an index to its ordinal. /// \tparam Index A coordinate index type (array type) /// \param index The index to be converted to an ordinal index /// \return The ordinal index of \c index /// \throw When \c index is not included in this range. template - typename std::enable_if::type...>::value, ordinal_type>::type - ordinal(Index&& ... index) const { + ordinal_type ordinal(Index&& ... index) const { return ordinal_(std::forward(index)...); }