Date: Tue, 1 Aug 2023 15:10:37 +0500
> Can you clarify your question please? Are you asking about this example
>
> alignas(T) std::byte storage[sizeof(T)];
> T *ptr = ::new (&storage) T;
> foo(reinterpret_cast<T*>(&storage));
>
> or
>
> alignas(T) std::byte storage[sizeof(T)];
> foo(reinterpret_cast<T*>(&storage));
Is there much difference, when `reinterpret_cast<T*>(&storage)` is considered?
>
> alignas(T) std::byte storage[sizeof(T)];
> T *ptr = ::new (&storage) T;
> foo(reinterpret_cast<T*>(&storage));
>
> or
>
> alignas(T) std::byte storage[sizeof(T)];
> foo(reinterpret_cast<T*>(&storage));
Is there much difference, when `reinterpret_cast<T*>(&storage)` is considered?
Received on 2023-08-01 10:10:43