20 #include <condition_variable> 31 template<
typename _T,
typename _QueueT = std::queue<_T>>
39 std::lock_guard<decltype(x_mutex)> guard{
x_mutex};
40 m_queue.push(std::forward<_U>(_elem));
47 std::unique_lock<std::mutex> lock{
x_mutex};
48 m_cv.wait(lock, [
this]{
return !
m_queue.empty(); });
49 auto item = std::move(
m_queue.front());
57 std::condition_variable
m_cv;
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::condition_variable m_cv