This file contains hidden or 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 <eggs/variant.hpp> | |
#include <cstddef> | |
#include <iomanip> | |
#include <iostream> | |
#include <map> | |
#include <sstream> | |
#include <string> | |
#include <utility> | |
#include <vector> |
This file contains hidden or 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 <cstddef> | |
#include <cstring> | |
#include <cwctype> | |
#include <functional> | |
#include <iostream> | |
#include <string> | |
#include <tuple> | |
#include <type_traits> | |
#include <utility> |
This file contains hidden or 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
#ifdef _MSC_VER | |
#define _CRT_SECURE_NO_WARNINGS | |
#endif | |
#include <algorithm> | |
#include <chrono> | |
#include <ctime> | |
#include <iomanip> | |
#include <iostream> | |
#include <sstream> |
This file contains hidden or 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 <algorithm> | |
#include <cstddef> | |
#include <iterator> | |
#include <type_traits> | |
#include <utility> | |
using namespace std; | |
template <typename InputIt, typename OutputIt, | |
typename FwdIt, typename F> |
This file contains hidden or 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 <algorithm> | |
#include <array> | |
#include <chrono> | |
#include <functional> | |
#include <iostream> | |
#include <iterator> | |
#include <limits> | |
#include <random> | |
#include <type_traits> |
This file contains hidden or 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 <cstddef> | |
#include <iostream> | |
#include <type_traits> | |
#include <utility> | |
using namespace std; | |
template <typename T, T Start, T... Ts> | |
const auto& make_int_range_helper(std::integer_sequence<T, Ts...>) { | |
static const initializer_list<int> il{ (Start+Ts)...}; |
This file contains hidden or 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
constexpr uint64_t lo(uint64_t x) { return x & UINT64_C(0xffffffff); } | |
constexpr uint64_t hi(uint64_t x) { return x >> 32; } | |
constexpr uint64_t mulu64(uint64_t a, uint64_t b) | |
{ | |
return lo(lo(a) * lo(b)) | |
+ (lo(hi(lo(a) * lo(b)) | |
+ lo(a) * hi(b) | |
+ hi(a) * lo(b)) << 32); | |
} |
This file contains hidden or 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
// 2017 Pi Day challenge: | |
// http://www.fluentcpp.com/2017/03/02/the-pi-day-challenge-for-expressive-code-in-c/ | |
#include <algorithm> | |
#include <array> | |
#include <cmath> | |
#include <functional> | |
#include <iomanip> | |
#include <iostream> | |
#include <random> |
This file contains hidden or 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
#pragma once | |
#include <type_traits> | |
#include <utility> | |
#if __cplusplus >= 201703L | |
// C++17 has variadic using | |
template <typename... Fs> |
This file contains hidden or 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 <algorithm> | |
#include <cassert> | |
#include <iostream> | |
#include <memory> | |
#include <utility> | |
using namespace std; | |
struct Foo | |
{ |