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 <stdio.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#define HEXDUMP_MIN(X, Y) ((X) < (Y) ? (X) : (Y)) | |
static void hexdump8(FILE *out, const uint8_t *first, const uint8_t *last) { | |
const uint8_t *stop = HEXDUMP_MIN(first + 8, last); | |
const uint8_t *k; | |
for(k = first; k != stop; ++k) { |
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 <string> | |
#include <array> | |
#include <iostream> | |
// compile-time string from | |
// http://blog.biicode.com/template-metaprogramming-cpp-ii/ | |
template <char... C> struct String { | |
static constexpr std::array<char, sizeof...(C)+1> data = {{C..., '\0'}}; | |
constexpr operator const char *() const { return data.data(); } | |
}; |
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 <iostream> | |
#include <string> | |
#include <mutex> | |
#include <thread> | |
#include <future> | |
#include <deque> | |
#include <nghttp2/asio_http2_server.h> | |
using namespace nghttp2::asio_http2; |
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 <iostream> | |
#include <string> | |
#include <mutex> | |
#include <thread> | |
#include <future> | |
#include <deque> | |
#include <nghttp2/asio_http2_server.h> | |
using namespace nghttp2::asio_http2; |
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 <iostream> | |
#include <cxxabi.h> | |
template <typename T> struct TypeDescriptor {}; | |
// function | |
template <typename Ret, typename... Args> | |
std::ostream &operator<<(std::ostream &os, | |
const TypeDescriptor<Ret(Args...)> &td) { | |
return os << "function returning " << TypeDescriptor<Ret>(); |
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
/* | |
* nghttp2 - HTTP/2 C Library | |
* | |
* Copyright (c) 2016 Tatsuhiro Tsujikawa | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to |
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 <cstdint> | |
#include <type_traits> | |
#include <array> | |
#include <iostream> | |
#include <iterator> | |
template <int64_t... Args> struct Array { | |
const std::array<int64_t, sizeof...(Args)> data; | |
constexpr Array() : data{{Args...}} {} | |
}; |
OlderNewer