Skip to content

Commit

Permalink
Fix the exemple
Browse files Browse the repository at this point in the history
  • Loading branch information
zosrothko committed Jan 13, 2016
1 parent 65980a8 commit c6b5b03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ succeeded = q.try_dequeue(number); // Returns false if the queue was empty
assert(succeeded && number == 17);

// You can also peek at the front item of the queue (consumer only)
int* front = q.peek(); // Returns nullptr if the queue was empty
assert(front == nullptr);
int* front = q.peek();
assert(*front == 18);
succeeded = q.try_dequeue(number);
assert(succeeded && number == 18);
front = q.peek();
assert(front == nullptr); // Returns nullptr if the queue was empty
```
The blocking version has the exact same API, with the addition of a `wait_dequeue` method:
Expand Down

0 comments on commit c6b5b03

Please sign in to comment.