From dd0570f4c7babf825c255d4a70eb65cdfbef98c3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 Feb 2026 18:10:04 +0000 Subject: Allow specifying all three partition functions independently Two predicate version behaviour is unchanged, the second predicate is just the inverse of the third. --- gfx/gl/instanceVertices.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gfx/gl/instanceVertices.h b/gfx/gl/instanceVertices.h index 2417a91..ecadf8f 100644 --- a/gfx/gl/instanceVertices.h +++ b/gfx/gl/instanceVertices.h @@ -143,10 +143,17 @@ public: template PartitionResult partition(Pred1 pred1, Pred2 pred2) + { + return partition(pred1, std::not_fn(pred2), pred2); + } + + template + PartitionResult + partition(Pred1 pred1, Pred2 pred2, Pred3 pred3) { auto boundary1 = partition(base::begin(), base::end(), pred1); - auto begin2 = partition(base::begin(), boundary1, std::not_fn(pred2)); - auto end2 = partition(boundary1, base::end(), pred2); + auto begin2 = partition(base::begin(), boundary1, pred2); + auto end2 = partition(boundary1, base::end(), pred3); return {indexOf(boundary1), {indexOf(begin2), indexOf(end2)}}; } -- cgit v1.3