Skip to content

Instantly share code, notes, and snippets.

#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/define_struct.hpp>
#include <boost/fusion/include/define_struct.hpp>
#include <boost/fusion/container/vector/convert.hpp>
#include <boost/fusion/include/as_vector.hpp>
#include <string>
#include <cstdint>
@edouarda
edouarda / port_win.cc
Created November 8, 2016 20:57
quasardb's rocksdb win32 port
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#if !defined(OS_WIN) && !defined(WIN32) && !defined(_WIN32)
//
// chat_client.cpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/asio.hpp>
#include <iostream>
int main(int, char **)
{
boost::asio::io_context context;
auto ip = boost::asio::ip::address::from_string("127.0.0.1");
auto ep = boost::asio::ip::tcp::endpoint{ip, 666};
#include <boost/asio.hpp>
#include <iostream>
int main(int argc, char ** argv)
{
try
{
boost::asio::io_context io_context;
boost::asio::ip::tcp::socket s{io_context};
#include <boost/asio.hpp>
#include <iostream>
int main(int, char **)
{
boost::asio::io_context context;
const boost::asio::ip::udp::endpoint ep{boost::asio::ip::udp::v4(), 8080};
boost::asio::ip::udp::socket s{context, ep};
#include <boost/asio.hpp>
#include <iostream>
int main(int argc, char ** argv)
{
try
{
boost::asio::io_context io_context;
boost::asio::ip::udp::socket s{io_context,
#include <boost/asio.hpp>
#include <iostream>
int main(int, char **)
{
boost::asio::io_context context;
auto ip = boost::asio::ip::address::from_string("127.0.0.1");
auto ep = boost::asio::ip::tcp::endpoint{ip, 8080};
#include <boost/asio.hpp>
#include <iostream>
class session : public std::enable_shared_from_this<session>
{
public:
explicit session(boost::asio::ip::tcp::socket && s)
: _socket{std::move(s)}
{}
@edouarda
edouarda / bench.hpp
Last active February 14, 2018 12:50
#pragma once
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <boost/accumulators/statistics/min.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <chrono>
#include <iostream>