C++ Logo

std-proposals

Advanced search

Re: [std-proposals] move_as

From: Julien Villemure-Fréchette <julien.villemure_at_[hidden]>
Date: Thu, 05 Jun 2025 19:45:32 -0400
How is this different from calling move with explicit template argument?

std::move<T>(u);


On June 3, 2025 11:52:20 p.m. EDT, Tymi via Std-Proposals <std-proposals_at_[hidden]> wrote:
>A move-as function that would perform a conversion when moving, possible
>implementation:
>template<typename T, typename U>
>constexpr T&& move_as(U&& u) noexcept
>{
> return static_cast<T&&>(static_cast<U&&>(u));
>}
>
>It would work on rvalue ref qualified conversions
>
>Tymi.

Received on 2025-06-05 23:45:40