Skip to content

Instantly share code, notes, and snippets.

#include <thread>
#include <iomanip>
#include <iostream>
#include <sys/types.h>
#include <sys/shm.h>
#include <sys/ipc.h>
int main()
{
static auto now = +[](std::ostream &os)->std::ostream& {
auto now = std::chrono::high_resolution_clock::now();
struct A
{
};
struct B
{
B(const A&){}
void foo();
};
@je4d
je4d / gist:4341994
Created December 20, 2012 00:22
Demo of isolates with preemptible execution in v8 js
#include <chrono>
#include <memory>
#include <string>
#include <atomic>
#include <thread>
#include <iostream>
#include <v8.h>
int main()
{
#include <iostream>
#include <type_traits>
#include <utility>
template<typename T>
struct move_on_copy
{
move_on_copy(T&& aValue) : value(std::move(aValue)) {}
move_on_copy(const move_on_copy& other) : value(std::move(other.value)) {}