'Where can I find what std::launder really does? [duplicate]

I am trying to understand what std::launder does, and I hoped that by looking up an example implementation it would be clear.

Where can I find an example implementation of std::launder?

When I looked in lbic++ I see a code like

  template<typename _Tp>
    [[nodiscard]] constexpr _Tp*
    launder(_Tp* __p) noexcept
    { return __builtin_launder(__p); }

Which makes me think that this another of those compiler-magic functions.

What is that this function __builtin_launder can potentially do, does it simply add a tag to suppress compiler warnings about aliasing?

Is it possible to understand std::launder in terms of __builtin_launder or it just more compiler-magic (hooks)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source