| 101 | size_t size() const { return std::min(elements_.size(), limit_); } |
| 102 | |
| 103 | bool empty() const { return size() == 0; } |
| 104 | |
| 105 | // If you know how many elements you will push at the time you create the |
| 106 | // TopN object, you can call reserve to preallocate the memory that TopN |