| 40 | |
| 41 | template <size_t Sz> |
| 42 | int netmaskWeightImpl(std::array<unsigned char, Sz> const& addr) { |
| 43 | int count = 0; |
| 44 | for (int i = 0; i < addr.size() && addr[i] != 0xff; ++i) { |
| 45 | std::bitset<8> b(addr[i]); |
| 46 | count += 8 - b.count(); |
| 47 | } |
| 48 | return count; |
| 49 | } |
| 50 | |
| 51 | } // namespace |
| 52 |
no test coverage detected