Skip to content

Instantly share code, notes, and snippets.

/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
import Foundation
protocol Initializable {
init()
}
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
import Foundation
protocol Receiver<T> {
associatedtype T
func setValue(_ value: T)
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
#include <thread>
#include <vector>
auto new_thread() {
return [](auto p) {
std::thread { [p=std::move(p)]() mutable {
#include <thread>
auto async_work() {
return [](auto p) {
std::thread { [p=std::move(p)]() mutable {
std::exception_ptr ep;
try {
throw std::runtime_error("Test Error");
} catch (...) {
ep = std::current_exception();
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
#include <iostream>
#include <thread>
using namespace std;
auto new_thread() {
return [](auto p) {
//
// BikeRRUITests.swift
// BikeRRUITests
//
// Created by Oliver Epper on 14.08.21.
//
// swiftlint:disable all
import XCTest
#include <iostream>
#include <asio.hpp>
#include <array>
using asio::ip::tcp;
using asio::buffer;
void handle_with_future(tcp::socket& client)
{
std::future<std::size_t> bytes_written = client.async_write_some(buffer("Welcome to my nightmare\n"), asio::use_future);
import Foundation
struct Output: TextOutputStream {
mutating func write(_ string: String) {
print(string, terminator: "")
}
}
protocol Drawable {
func draw_(out: inout Output, position: Int)
#include <iostream>
#include <vector>
using namespace std;
template<typename T> void draw(const T& x, ostream& out, size_t position);
class object_t {
public:
template<typename T> object_t(T x) : self_(make_unique<model<T>>(move(x))) {}