Skip to content

Instantly share code, notes, and snippets.

@Flast
Flast / gist:729d4b2e8ff380bf0255def4b969149a
Created September 1, 2016 06:20
I want this method!!!!!!!!!!!!!!!!
template <typename T, typename... A>
template <typename R, typename... V, typename = std::void_t<
std::enable_if_t<std::is_convertible_v<R, T>>
, std::enable_if_t<std::is_convertible_v<V, A>>...
>>
explicit std::packaged_task<T(A...)>::packaged_task(std::packaged_task<R(V...)>&& other);
function pp(object, depth, embedded) {
typeof(depth) == "number" || (depth = 0)
typeof(embedded) == "boolean" || (embedded = false)
var newline = false
var spacer = function(depth) { var spaces = ""; for (var i=0;i<depth;i++) { spaces += " "}; return spaces }
var pretty = ""
if ( typeof(object) == "undefined" ) { pretty += "undefined" }
else if ( typeof(object) == "boolean" ||
typeof(object) == "number" ) { pretty += object.toString() }
else if ( typeof(object) == "string" ) { pretty += "\"" + object + "\"" }
@Flast
Flast / client.cpp
Created December 8, 2012 12:36
Graceful Restart with Boost.Asio
#define BOOST_RESULT_OF_USE_DECLTYPE
#include <chrono>
#include <thread>
#include <boost/mpi.hpp>
#include <iostream>
#include <sstream>
#include <utility>