File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
wpiutil/src/main/native/include/wpi/struct Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ inline T UnpackStruct(std::span<const uint8_t> data) {
147
147
*/
148
148
template <StructSerializable T, size_t Offset, size_t N>
149
149
inline wpi::array<T, N> UnpackStructArray (std::span<const uint8_t > data) {
150
- const auto StructSize = Struct<std::remove_cvref_t <T>>::kSize ;
150
+ constexpr auto StructSize = Struct<std::remove_cvref_t <T>>::kSize ;
151
151
wpi::array<T, N> arr (wpi::empty_array);
152
152
[&]<size_t ... Is>(std::index_sequence<Is...>) {
153
153
((arr[Is] = UnpackStruct<T, Offset + Is * StructSize>(data)), ...);
@@ -197,7 +197,7 @@ inline void PackStruct(std::span<uint8_t> data, T&& value) {
197
197
template <size_t Offset, size_t N, StructSerializable T>
198
198
inline void PackStructArray (std::span<uint8_t > data,
199
199
const wpi::array<T, N>& arr) {
200
- const auto StructSize = Struct<std::remove_cvref_t <T>>::kSize ;
200
+ constexpr auto StructSize = Struct<std::remove_cvref_t <T>>::kSize ;
201
201
[&]<size_t ... Is>(std::index_sequence<Is...>) {
202
202
(PackStruct<Offset + Is * StructSize>(data, arr[Is]), ...);
203
203
}(std::make_index_sequence<N>{});
You can’t perform that action at this time.
0 commit comments