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> | |
enum class Endianness | |
{ | |
LITTLE, | |
BIG | |
}; | |
Endianness makeEndianness() | |
{ |
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
// http://coliru.stacked-crooked.com/a/661e096db956eca7 | |
// Timing on my computer (with larger benchmarks) | |
// 0s 907ms 747us (benchmark_16_2048000_FULL_BUILD) | |
// 0s 919ms 263us (benchmark_16_2048000_SPTR_BUILD) | |
// 0s 620ms 877us (benchmark_16_2048000_FULL_PROBE) | |
// 0s 697ms 964us (benchmark_16_2048000_SPTR_PROBE) | |
// | |
// 0s 578ms 693us (benchmark_64_1024000_FULL_BUILD) | |
// 0s 527ms 744us (benchmark_64_1024000_SPTR_BUILD) | |
// 0s 440ms 486us (benchmark_64_1024000_FULL_PROBE) |
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 <type_traits> | |
#include <memory> | |
#include <vector> | |
#include <iostream> | |
namespace buffer | |
{ | |
template <class Type> |
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 <type_traits> | |
#include <memory> | |
#include <vector> | |
#include <iostream> | |
namespace buffer | |
{ | |
template <class Type> |
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 <type_traits> | |
#include <memory> | |
#include <iostream> | |
namespace buffer | |
{ | |
template <class Type> | |
struct TView |
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
// http://coliru.stacked-crooked.com/a/79b95603bd598fc4 | |
// http://coliru.stacked-crooked.com/a/329eb69e036b8d4b | |
// http://coliru.stacked-crooked.com/a/3a4c06d979ae966c | |
// http://coliru.stacked-crooked.com/a/e81b99fdd5e2b596 | |
#include <type_traits> | |
#include <iostream> | |
#include <utility> | |
#include <cstdint> | |
#include <vector> | |
#include <cmath> |
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
// https://coliru.stacked-crooked.com/a/0ba6c5762255a8e3 | |
#include <iostream> | |
#include <utility> | |
#include <cstdint> | |
class XorShifter | |
{ | |
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
// http://coliru.stacked-crooked.com/a/f567a9698865eb15 | |
#include <type_traits> | |
#include <utility> | |
#include <cstdint> | |
#include <memory> | |
#include <iostream> | |
/******************************** |
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
// https://coliru.stacked-crooked.com/a/a138703355819566 | |
#include <string_view> | |
#include <iostream> | |
#include <cstdint> | |
template <uint8_t low, | |
uint8_t high> | |
struct TIsBetween | |
{ |
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 <functional> | |
#include <iostream> | |
#include <limits> | |
#include <vector> | |
#include <stack> | |
enum Token | |
{ | |
NUM, | |
ADD, // from there the token are stripped from the tree |