This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#include <string_view> | |
#include <tuple> | |
#include <charconv> | |
#include <iostream> | |
template <typename CRTP> | |
class UnbufferedPushDecoder | |
{ | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <atomic> | |
#include <cstdint> | |
#include <thread> | |
#include <iostream> | |
struct SeqLockThing | |
{ | |
std::atomic<std::uint64_t> begin_version = 0; | |
int a = 0; | |
int b = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/asio/buffer.hpp> | |
#include <boost/container/deque.hpp> | |
#include <boost/iterator/iterator_adaptor.hpp> | |
#include <string> | |
struct strings_deque_buffer_reference | |
{ | |
std::string& str; | |
operator boost::asio::mutable_buffer() const noexcept { return boost::asio::buffer(str); } | |
operator boost::asio::const_buffer() const noexcept { return boost::asio::buffer(str); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <array> | |
#include <boost/fusion/adapted/adt/adapt_adt.hpp> | |
#include <boost/preprocessor.hpp> | |
#include <stdexcept> | |
#include "faef.hpp" | |
#define DEFINE_INIT_LIST_PLACEHOLDER_0_END | |
#define DEFINE_INIT_LIST_PLACEHOLDER_1_END | |
#define DEFINE_INIT_LIST_PLACEHOLDER_0(X, Y, Z) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/preprocessor.hpp> | |
// the magic | |
#define MAGIC_PLACEHOLDER_FILLER_0(X, Y) ((X, Y)) MAGIC_PLACEHOLDER_FILLER_1 | |
#define MAGIC_PLACEHOLDER_FILLER_1(X, Y) ((X, Y)) MAGIC_PLACEHOLDER_FILLER_0 | |
#define MAGIC_PLACEHOLDER_FILLER_0_END | |
#define MAGIC_PLACEHOLDER_FILLER_1_END | |
// example usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Outputs: | |
Serialized Bytes: 464 | |
Bids: [ | |
{3, 0, 100}, | |
{1, 1.13, 1000}, | |
{2, 1.12, 500}, | |
{4, 1.12, 250} | |
] | |
Asks: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RFCs | |
==== | |
RFC 1035 : Domain names - implementation and specification, November 1987 | |
RFC 2181 : Clarifications to the DNS Specification, July 1997 | |
- defines an "RRSet" as combination of class, name and type. | |
- deprecates differing TTLs within an RRSet, says should be treated as | |
an error. | |
- defines the "origin" as the child name just below the zone cut: | |
"The name of the zone is the same as the name of the domain | |
at the zone's origin." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename BufferSequence> | |
auto | |
async_write (tcp::socket& socket, BufferSequence const& buffers) { | |
struct Awaitable { | |
tcp::socket& socket; | |
BufferSequence const& buffers; | |
boost::system::error_code ec; | |
bool | |
await_ready () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
std::enable_if_t<std::is_base_of<flatbuffers::NativeTable, T>::value, | |
boost::system::error_code> | |
operator() (tcp::socket& socket, Message::Header const& header, T& body, | |
asio::yield_context ctx) const { | |
boost::system::error_code ec; | |
/* TODO: Inefficient and dangerous, huzzah! */ | |
std::vector<unsigned char> buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/mpl/at.hpp> | |
#include <boost/mpl/size.hpp> | |
#include <boost/variant/variant.hpp> | |
#include <type_traits> | |
namespace { | |
template <size_t N> | |
struct emplace_nth_helper { | |
template <typename Variant, typename Transform> |
NewerOlder