From 2ae1d33489c22ce773d53b35fcd7842086a4daea Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:40:25 +0100 Subject: [PATCH 1/5] DPL: Simplify prune_voids_pack Use the requirements directly on the template arguments. --- Framework/Foundation/include/Framework/Pack.h | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Framework/Foundation/include/Framework/Pack.h b/Framework/Foundation/include/Framework/Pack.h index 2355ffed6b35b..4fcf796a3ec62 100644 --- a/Framework/Foundation/include/Framework/Pack.h +++ b/Framework/Foundation/include/Framework/Pack.h @@ -114,42 +114,43 @@ consteval auto prune_voids_pack(Result result, pack<>) return result; } +template +concept void_pack_element = std::is_void_v; + +template +concept nonvoid_pack_element = !void_pack_element; + // The first one is non void, but one of the others is void -template - requires(!std::is_void_v) +template consteval auto prune_voids_pack(pack result, pack) { return prune_voids_pack(pack{}, pack{}); } // The first one is void -template - requires(std::is_void_v) +template consteval auto prune_voids_pack(pack result, pack) { return prune_voids_pack(pack{}, pack{}); } // The first one is non void, but one of the others is void -template - requires(!std::is_void_v && !std::is_void_v) +template consteval auto prune_voids_pack(pack result, pack) { return prune_voids_pack(pack{}, pack{}); } // Eats 4 types at the time -template - requires(!std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v) +template consteval auto prune_voids_pack(pack result, pack) { return prune_voids_pack(pack{}, pack{}); } // Eats 8 types at the time -template - requires(!std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v && !std::is_void_v) +template consteval auto prune_voids_pack(pack result, pack) { return prune_voids_pack(pack{}, pack{}); From f4f29a3806e1371773c4ab7605fdd5845377dd45 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:40:25 +0100 Subject: [PATCH 2/5] DPL: use constraints directly on arguments in place of requires --- Framework/Foundation/include/Framework/Endian.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Framework/Foundation/include/Framework/Endian.h b/Framework/Foundation/include/Framework/Endian.h index a8fee915ee340..5b69591030249 100644 --- a/Framework/Foundation/include/Framework/Endian.h +++ b/Framework/Foundation/include/Framework/Endian.h @@ -33,24 +33,20 @@ #define O2_BIG_ENDIAN __BIG_ENDIAN #define O2_LITTLE_ENDIAN __LITTLE_ENDIAN - template - requires std::same_as -inline uint16_t doSwap(uint16_t x) +inline uint16_t doSwap(std::same_as auto x) { return swap16_(x); } template - requires std::same_as -inline uint32_t doSwap(uint32_t x) +inline uint32_t doSwap(std::same_as auto x) { return swap32_(x); } template - requires std::same_as -inline uint64_t doSwap(uint64_t x) +inline uint64_t doSwap(std::same_as auto x) { return swap64_(x); } From 9223d27c6e4c8f28e60f13fa2dcc646cb479178b Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:37:13 +0100 Subject: [PATCH 3/5] Update Framework/Foundation/include/Framework/Endian.h --- Framework/Foundation/include/Framework/Endian.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Framework/Foundation/include/Framework/Endian.h b/Framework/Foundation/include/Framework/Endian.h index 5b69591030249..37b92fe63d383 100644 --- a/Framework/Foundation/include/Framework/Endian.h +++ b/Framework/Foundation/include/Framework/Endian.h @@ -33,7 +33,6 @@ #define O2_BIG_ENDIAN __BIG_ENDIAN #define O2_LITTLE_ENDIAN __LITTLE_ENDIAN -template inline uint16_t doSwap(std::same_as auto x) { return swap16_(x); From 8c1e64838f48e72b9a489bfb781ebbc22d50929f Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:37:29 +0100 Subject: [PATCH 4/5] Update Framework/Foundation/include/Framework/Endian.h --- Framework/Foundation/include/Framework/Endian.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Framework/Foundation/include/Framework/Endian.h b/Framework/Foundation/include/Framework/Endian.h index 37b92fe63d383..a1e8b7a66095e 100644 --- a/Framework/Foundation/include/Framework/Endian.h +++ b/Framework/Foundation/include/Framework/Endian.h @@ -38,7 +38,6 @@ inline uint16_t doSwap(std::same_as auto x) return swap16_(x); } -template inline uint32_t doSwap(std::same_as auto x) { return swap32_(x); From cb9ee51a2282aaae127f22344f8ff58ce75f0aa2 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:37:51 +0100 Subject: [PATCH 5/5] Update Framework/Foundation/include/Framework/Endian.h --- Framework/Foundation/include/Framework/Endian.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Framework/Foundation/include/Framework/Endian.h b/Framework/Foundation/include/Framework/Endian.h index a1e8b7a66095e..06474f7b04e6c 100644 --- a/Framework/Foundation/include/Framework/Endian.h +++ b/Framework/Foundation/include/Framework/Endian.h @@ -43,7 +43,6 @@ inline uint32_t doSwap(std::same_as auto x) return swap32_(x); } -template inline uint64_t doSwap(std::same_as auto x) { return swap64_(x);