* Try to pop an element from the queue. * @return false if the queue is empty now. */
| 157 | * @return false if the queue is empty now. |
| 158 | */ |
| 159 | bool TryPop(T& e) { |
| 160 | Element ele; |
| 161 | if (queue_.TryPop(ele)) { |
| 162 | e = ele.data; |
| 163 | return true; |
| 164 | } else { |
| 165 | return false; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * @return Number of elements in the queue. |