Skip to content

Instantly share code, notes, and snippets.

@dolphin8
dolphin8 / lisp.cc
Created September 28, 2017 08:01
list processing in modern c++
#include <utility>
namespace demo {
template <typename Hd, typename Tl>
using cons_t = std::pair<Hd, Tl>;
constexpr auto nil = nullptr;
constexpr auto cons(auto hd, auto tl) {
return std::make_pair(hd, tl);
@dolphin8
dolphin8 / simple-http-server.cc
Last active February 2, 2022 03:43
using boost::asio with boost::context::callcc
#include <iostream>
#include <utility>
#include <boost/context/all.hpp>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
namespace spawn {
namespace asio = boost::asio;
namespace ctx = boost::context;