Skip to content

Instantly share code, notes, and snippets.

Joshua Marantz jmarantz

Block or report user

Report or block jmarantz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <memory>
#include <string>
class InlineStorage {
// Custom delete operator to keep C++14 from using the global operator delete(void*, size_t),
jmarantz / gist:d22b836cee3ca203cc368553eda81ce5
Created May 22, 2018
alternate implementation of CondVar using std::condition_variable_any
View gist:d22b836cee3ca203cc368553eda81ce5
class CondVar {
// Note that it is not necessary to be holding an associated mutex to call signal).
// See the discussion in
// for more details.
void notifyOne() { condvar_.notify_one(); }
void notifyAll() { condvar_.notify_all(); };
template <class LockGuard>
void wait(LockGuard& guard) EXCLUSIVE_LOCKS_REQUIRED(guard) {
You can’t perform that action at this time.