bit_cast

bit_cast#

stdgpu: stdgpu::bit_cast
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ bit_cast()

template<typename To , typename From , STDGPU_DETAIL_OVERLOAD_IF(sizeof(To)==sizeof(From) &&std::is_trivially_copyable_v< To > && std::is_trivially_copyable_v< From >) >
STDGPU_HOST_DEVICE To stdgpu::bit_cast ( const From &  object)
noexcept

Reinterprets the object of the given type as an instance of the desired type.

Parameters
[in]objectAn object
Returns
The same object reinterpreted as an instance of the desired type