File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616#ifndef STDGPU_BIT_DETAIL_H
1717#define STDGPU_BIT_DETAIL_H
1818
19+ #include < cstddef>
20+
1921#include < stdgpu/contract.h>
2022#include < stdgpu/limits.h>
2123
@@ -136,12 +138,12 @@ bit_cast(const From& object)
136138 To result;
137139
138140 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
139- auto * result_bytes = reinterpret_cast <unsigned char *>(&result);
141+ auto * result_bytes = reinterpret_cast <std::byte *>(&result);
140142
141143 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
142- const auto * object_bytes = reinterpret_cast <const unsigned char *>(&object);
144+ const auto * object_bytes = reinterpret_cast <const std::byte *>(&object);
143145
144- for (unsigned int i = 0 ; i < sizeof (To); ++i)
146+ for (std:: size_t i = 0 ; i < sizeof (To); ++i)
145147 {
146148 result_bytes[i] = object_bytes[i];
147149 }
You can’t perform that action at this time.
0 commit comments