| 293 | typename mem_manager |
| 294 | > |
| 295 | void queue_kernel_2<T,block_size,mem_manager>:: |
| 296 | dequeue ( |
| 297 | T& item |
| 298 | ) |
| 299 | { |
| 300 | // swap out into item |
| 301 | exchange(item,out->item[out_pos]); |
| 302 | |
| 303 | ++out_pos; |
| 304 | --queue_size; |
| 305 | |
| 306 | // if this was the last element in this node then remove this node |
| 307 | if (out_pos == block_size) |
| 308 | { |
| 309 | out_pos = 0; |
| 310 | node* temp = out; |
| 311 | out = out->next; |
| 312 | pool.deallocate(temp); |
| 313 | } |
| 314 | else if (queue_size == 0) |
| 315 | { |
| 316 | pool.deallocate(out); |
| 317 | } |
| 318 | |
| 319 | // put the enumerator at the start |
| 320 | reset(); |
| 321 | } |
| 322 | |
| 323 | // ---------------------------------------------------------------------------------------- |
| 324 |
nothing calls this directly
no test coverage detected