Skip to content

Commit 751b86c

Browse files
committed
Update example types and fix minor formatting in README
1 parent bd341cd commit 751b86c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void emplace_producer(LockFreeSpscQueue<MyData>& queue)
6767
{
6868
// We have a reservation. Its actual capacity might be less than 16.
6969
// We should always check the return value of try_emplace in robust code.
70-
70+
7171
// Attempt to emplace the first item.
7272
bool success1 = transaction->try_emplace("hello", 100);
7373
@@ -91,7 +91,7 @@ void emplace_producer(LockFreeSpscQueue<MyData>& queue)
9191
`try_push` is ideal for trivial types (like `int` or `float`) or when you already have an existing object that you want to move into the queue.
9292

9393
```cpp
94-
void high_frequency_producer(LockFreeSpscQueue<Message>& queue)
94+
void high_frequency_producer(LockFreeSpscQueue<int>& queue)
9595
{
9696
int next_item = 0;
9797

@@ -195,7 +195,7 @@ void low_level_batch_producer(LockFreeSpscQueue<Message>& queue,
195195
}
196196
```
197197
198-
Note: This low-level example performs a single write attempt. In a real-world scenario, you would typically place this logic inside a loop (similar to the try_write example) to handle cases where the queue is initially full and to ensure all data is eventually sent.
198+
Note: This low-level example performs a single write attempt. In a real-world scenario, you would typically place this logic inside a loop (similar to the try\_write example) to handle cases where the queue is initially full and to ensure all data is eventually sent.
199199
200200
---
201201

0 commit comments

Comments
 (0)