Skip to content

Commit a29d971

Browse files
Write full message
1 parent 8d0616c commit a29d971

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

examples/multithreading.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <cstdint>
22
#include <cstdlib>
33
#include <iostream>
4+
#include <sstream>
45
#include <thread>
56
#include <utility>
67

@@ -15,7 +16,9 @@ int main()
1516
// Read
1617
const auto out = [](msd::channel<std::int64_t>& ch, std::size_t i) {
1718
for (auto number : ch) {
18-
std::cout << number << " from thread: " << i << '\n';
19+
std::stringstream stream;
20+
stream << number << " from thread: " << i << '\n';
21+
std::cout << stream.str();
1922
std::this_thread::sleep_for(std::chrono::milliseconds(500));
2023
}
2124
};

0 commit comments

Comments
 (0)