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
// NUM | |
template <typename T, T Val> | |
struct _NUM_IMPL | |
{ | |
static const T value = Val; | |
}; | |
#define NUM(val) _NUM_IMPL <decltype (val), val> |
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 <optional> | |
template <typename T> | |
class lazy | |
{ | |
std::optional <T> result; | |
std::function <T ()> generator; | |
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 <sys/mman.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <cuda_runtime.h> | |
#include <cerrno> | |
#include <cstring> | |
#include <memory> | |
#include <stdexcept> |
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
/* Copyright 2021 Stuart Olsen | |
* | |
* 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 permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in |
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 <climits> | |
template <char c> | |
inline constexpr | |
unsigned long long int binary_digit () | |
{ | |
static_assert (c == '0' || c == '1', "bad bit in binary literal"); | |
return (c - '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
#ifndef UNIFORM_INT_H | |
#define UNIFORM_INT_H | |
#ifndef _POSIX_C_SOURCE | |
# define _POSIX_C_SOURCE 200112L | |
#elif _POSIX_C_SOURCE < 200112L | |
# undef _POSIX_C_SOURCE | |
# define _POSIX_C_SOURCE 200112L | |
#endif |
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 <vector> | |
#include <iterator> | |
#ifndef NDEBUG | |
static int nth_input = 0; | |
#endif | |
using integer = int; | |
using key_type = std::vector <integer>; | |
using key_iter = typename key_type::const_iterator; |
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 <random> | |
using integer = int; | |
using distribution = std::uniform_int_distribution <integer>; | |
std::mt19937 engine {}; | |
#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
#include <stack> | |
#include <unordered_map> | |
#include <typeindex> | |
class MultiStack | |
{ | |
class MultiStackBase | |
{ | |
public: | |
virtual ~MultiStackBase () = default; |
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
(defpackage parse | |
(:use :common-lisp) | |
(:export :parse-protocol | |
:bad-form | |
:bad-header | |
:bad-type | |
:form | |
:name)) | |
(in-package :parse) |
OlderNewer