This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <atomic> | |
#include <exception> | |
#include <iostream> | |
#include <memory> | |
#include <mutex> | |
#include <utility> | |
class JrpException : public ::std::exception {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <future> | |
#include <map> | |
#include <memory> | |
#include <string> | |
void do_thing(std::string a); // forces a copy | |
void do_thing_ref(std::string& a); // no copy, can mutate a | |
void do_thing_ptr(std::string* a); // no copy, can obviously mutate a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
#include <setjmp.h> | |
#include <signal.h> | |
#include <sigsegv.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
struct bond { | |
uintptr_t dof; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <future> | |
#include <list> | |
#include <queue> | |
#include <thread> | |
#include <vector> | |
class State { | |
public: | |
State(): started(false), pending_get_values(false), exiting(false) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <mutex> | |
#include <type_traits> | |
template <typename Mutex, typename... Args> | |
auto make_unique_lock(Mutex&& m, Args&&... args) | |
-> std::unique_lock<typename std::remove_reference<Mutex>::type> { | |
return std::unique_lock<typename std::remove_reference<Mutex>::type>( | |
std::forward<Mutex>(m), std::forward<Args>(args)...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <err.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
static const char slash[] = "/"; | |
int main(__attribute__((unused)) int argc, char* argv[]) { | |
char *self; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <sstream> | |
#include <string> | |
namespace detail { | |
template <typename T, typename U> | |
class LexicalCast { | |
public: | |
T operator()(U const& u) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function main { | |
for cpu in ${CPUS[@]} | |
do | |
echo ==== $cpu ==== | |
check bazel build --ios_cpu=$cpu $DEPS | |
check mkdir -p $WORK/$cpu | |
for dep in $DEPS | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A {}; | |
class B { | |
public: | |
B() = default; | |
B(B const&) = delete; | |
}; | |
class C { | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <exception> | |
#include <utility> | |
// hypothetically... | |
class MyException : public std::exception { | |
public: | |
const char *what() const noexcept { | |
return "nope"; |