MCPcopy Create free account
hub / github.com/NetSys/bess / SetBitsLow

Function SetBitsLow

core/utils/bits.h:193–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191// For example: SetBitsLow<uint32_t>(9) will return 0x000001FF
192template <typename T, typename = std::enable_if<std::is_integral<T>::value>>
193static inline T SetBitsLow(size_t n) {
194 if (unlikely(n == 0)) {
195 return T{0};
196 }
197 return (n >= sizeof(T) * 8) ? ~T{0} : ~_SetBitsHigh<T>((sizeof(T) * 8) - n);
198}
199
200} // namespace utils
201} // namespace bess

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected