#include "blocking_iterator.hpp"
#include "nodiscard.hpp"
#include "storage.hpp"
#include <condition_variable>
#include <cstdlib>
#include <mutex>
#include <stdexcept>
#include <type_traits>
Go to the source code of this file.
|
| template<typename T, typename Storage> |
| channel< typename std::decay< T >::type, Storage > & | msd::operator<< (channel< typename std::decay< T >::type, Storage > &chan, T &&value) |
| | Pushes an element into the channel.
|
| template<typename T, typename Storage> |
| channel< T, Storage > & | msd::operator>> (channel< T, Storage > &chan, T &out) |
| | Pops an element from the channel.
|
◆ default_storage
Default storage for msd::channel.
- Template Parameters
-
| T | The type of the elements. |
◆ operator<<()
template<typename T, typename Storage>
| channel< typename std::decay< T >::type, Storage > & msd::operator<< |
( |
channel< typename std::decay< T >::type, Storage > & | chan, |
|
|
T && | value ) |
Pushes an element into the channel.
- Parameters
-
| chan | Channel to write to. |
| value | Value to write. |
- Returns
- Instance of channel.
- Exceptions
-
| closed_channel | if channel is closed. |
◆ operator>>()
template<typename T, typename Storage>
| channel< T, Storage > & msd::operator>> |
( |
channel< T, Storage > & | chan, |
|
|
T & | out ) |
Pops an element from the channel.
- Parameters
-
| chan | Channel to read from. |
| out | Where to write read value. |
- Returns
- Instance of channel.