diff --git a/Include/auROXTL/auCopyMoveUtils.hpp b/Include/auROXTL/auCopyMoveUtils.hpp index 01f4b2c..2aa5e36 100644 --- a/Include/auROXTL/auCopyMoveUtils.hpp +++ b/Include/auROXTL/auCopyMoveUtils.hpp @@ -9,7 +9,7 @@ /** * @brief Upcasts R-Value upcastable @param arg. - * For an L-Value equivalent hint, use AuReference + * For an L-Value equivalent hint, use AuReference * @tparam T * @param arg * @return @@ -27,12 +27,26 @@ auline constexpr AuRemoveReference_t &&AuMove(T &&arg) noexcept * @param arg * @return */ -template -auline constexpr T &AuReference(T &arg) noexcept +template && !AuIsLValueReference_v)> +auline constexpr AuRemoveReference_t &AuReference(T &arg) noexcept { return static_cast(arg); } +/** + * @brief Upcasts L-Value upcastable @param arg. + * For an R-Value equivalent hint, use AuMove + * Recommended use case: specifying constant ref method overload over move counterpart + * @tparam T An expression to implicitly upcast to a constant L-value + * @param arg + * @return +*/ +template && !AuIsLValueReference_v)> +auline constexpr const AuRemoveReference_t &AuConstReference(T &arg) noexcept +{ + return static_cast(arg); +} + /** * @brief Preserves R or L value without reducing; implicit AuMove or AuReference * @tparam T An expression to implicitly upcast to an R-value