UKismetMathLibrary::Xor_Int64Int64
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Performs a bitwise XOR on A and B and returns the result. Useful for toggling bits or computing the difference mask between two flag sets.
Caveats & Gotchas
- • XOR is its own inverse: applying the same mask twice restores the original value. This is useful for toggling flags but can be an unexpected footgun when the mask value changes between the two calls.
- • Like all bitwise int64 operations in Blueprint, the result is a signed int64 — a high bit set by XOR will produce a negative number if interpreted arithmetically.
Signature
static UE_INL_API int64 Xor_Int64Int64(int64 A, int64 B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | int64 | First operand. | — |
| B | int64 | Second operand. | — |
Return Type
int64 Example
Toggle a feature flag bit C++
const int64 DebugFlag = (1LL << 10);
int64 FeatureFlags = GetFeatureFlags();
FeatureFlags = UKismetMathLibrary::Xor_Int64Int64(FeatureFlags, DebugFlag); // toggles bit 10 See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?