MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / HasAtMostOneBit

Function HasAtMostOneBit

src/core/bitmath_func.hpp:266–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 */
265template <typename T>
266constexpr bool HasAtMostOneBit(T value)
267{
268 return (value & (value - 1)) == 0;
269}
270
271 /**
272 * Iterable ensemble of each set bit in a value.

Callers 8

ExploreSegmentFunction · 0.85
NeedsServicingMethod · 0.85
MaskWireBitsFunction · 0.85
ShowRefitOptionsListFunction · 0.85
DrawRoadBitsFunction · 0.85
TileLoop_RoadFunction · 0.85
AreOrderFlagsValidMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected