[PATCH] Use __builtin_addressof in std::addressof
Jonathan Wakely
jwakely@redhat.com
Wed Dec 18 18:49:46 GMT 2024
On Wed, 18 Dec 2024 at 18:39, François Dumont <frs.dumont@gmail.com> wrote:
>
> Hi
>
> As proposed on another thread here is the patch to make std::__addressof
> and std::addressof compile time equivalent.
>
> Maybe not entirely because of the [[__nodiscard__]] on std::addressof
> but still closer.
>
> libstdc++: Have std::addressof use __builtin_addressof
>
> Rather than calling std::__addressof in std::addressof we can directly
> call __builtin_addressof to bypass 1 function call.
>
> libstdc++-v3/ChangeLog:
>
> * include/bits/move.h (std::addressof): Call
> __builtin_addressof.
>
> Ok to commit ?
OK, thanks.
More information about the Libstdc++
mailing list