I hereby claim:
- I am boatilus on github.
- I am ovao (https://keybase.io/ovao) on keybase.
- I have a public key ASBNTfSbut9LBqYJHEu67Mfov5UEGCfJV_f9qiFZ4R7Fxgo
To claim this, I am signing this object:
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 <cassert> | |
#include <cstddef> | |
#include <string> | |
template <int8_t len> | |
class string { | |
private: | |
char arr[len + 1]; | |
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 <tuple> | |
#include <type_traits> | |
#include <cassert> | |
template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int); | |
template <class, class...> std::false_type test_is_braces_constructible(...); | |
template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0)); | |
struct any_type { | |
template<class T> |
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
/* | |
** LTOA.C | |
** | |
** Converts a long integer to a string. | |
** | |
** Copyright 1988-90 by Robert B. Stout dba MicroFirm | |
** | |
** Released to public domain, 1991 | |
** | |
** Parameters: 1 - number to be converted |
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
define [], -> | |
return class Vector | |
constructor: (@type, @wordLength, initialSize) -> | |
@buffer = new ArrayBuffer ((initialSize or 10) * wordLength) / 8 | |
@view = new window[type + wordLength + 'Array'] @buffer | |
type: '' | |
buffer: null | |
view: null |
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
namespace stdx { | |
template <size_t position, typename T, size_t size> | |
void set(std::array<T, size>& arr, const T& value) noexcept { | |
static_assert(position < size, "index out of bounds"); | |
arr[position] = value; | |
} | |
} |