* @brief Class template to print the contents of a BitSet to a String * @note Requires an implementation of `toString(E)` */
| 372 | * @note Requires an implementation of `toString(E)` |
| 373 | */ |
| 374 | size_t printTo(Print& p, const String& separator = ", ") const |
| 375 | { |
| 376 | extern String toString(E e); |
| 377 | |
| 378 | size_t n{0}; |
| 379 | |
| 380 | for(unsigned i = 0; i < size(); ++i) { |
| 381 | auto e = E(i); |
| 382 | if(!test(e)) { |
| 383 | continue; |
| 384 | } |
| 385 | if(n != 0) { |
| 386 | n += p.print(separator); |
| 387 | } |
| 388 | n += p.print(e); |
| 389 | } |
| 390 | |
| 391 | return n; |
| 392 | } |
| 393 | |
| 394 | private: |
| 395 | void IfHelper() const |
no test coverage detected