From 69560dba652deb5738d0f17b5e28b218a7c6e3b0 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sat, 20 Jan 2024 10:44:12 +0100 Subject: [PATCH] Fix xr::details::enumerate --- client/xr/details/enumerate.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/xr/details/enumerate.h b/client/xr/details/enumerate.h index 4fddfe8d..56dc803e 100644 --- a/client/xr/details/enumerate.h +++ b/client/xr/details/enumerate.h @@ -90,7 +90,11 @@ auto enumerate(F f, Args &&... args) -> auto if (XR_SUCCEEDED(result)) { - if constexpr (structure_type == XR_TYPE_UNKNOWN) + if constexpr (std::is_same_v) + { + array.resize(count - 1); // count includes the null terminator + } + else if constexpr (structure_type == XR_TYPE_UNKNOWN) { array.resize(count); }