UBlueprintSetLibrary::Set_Difference
#include "Kismet/BlueprintSetLibrary.h"
Access: public
Specifiers: staticBlueprintCallableCustomThunk
Description
Assigns Result to the relative difference of Set A and Set B — every element in A that is not also found in B.
Caveats & Gotchas
- • Difference is not commutative: A minus B is not the same as B minus A. Put the set whose elements you want to keep in the A slot.
- • Also called the relative complement of B in A.
Signature
static void Set_Difference(const TSet<int32>& A, const TSet<int32>& B, TSet<int32>& Result); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const TSet<int32>& | Wildcard placeholder for the starting set whose elements should be preserved. | — |
| B | const TSet<int32>& | Wildcard placeholder for the set of elements to remove from A. | — |
| Result | TSet<int32>& | Wildcard output set that receives every element in A not found in B. | — |
Return Type
void Example
Subtract one set from another C++
TSet<int32> A = {1, 2, 3};
TSet<int32> B = {2, 3, 4};
TSet<int32> Result = A.Difference(B); // {1} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?