| 191 | // For example: SetBitsLow<uint32_t>(9) will return 0x000001FF |
| 192 | template <typename T, typename = std::enable_if<std::is_integral<T>::value>> |
| 193 | static 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 |
nothing calls this directly
no outgoing calls
no test coverage detected