update headers

This commit is contained in:
Nick Fisher
2022-12-05 17:51:44 +08:00
parent 58942ba94d
commit e0f9cfbde6
234 changed files with 62619 additions and 9800 deletions

View File

@@ -31,7 +31,7 @@ class BinaryTreeArray {
// Simple fixed capacity stack
template<typename TYPE, size_t CAPACITY,
typename = typename std::enable_if<std::is_pod<TYPE>::value>::type>
typename = typename std::enable_if<std::is_trivial<TYPE>::value>::type>
class stack {
TYPE mElements[CAPACITY];
size_t mSize = 0;
@@ -52,8 +52,10 @@ class BinaryTreeArray {
public:
static size_t count(size_t height) noexcept { return (1u << height) - 1; }
static size_t left(size_t i, size_t height) noexcept { return i + 1; }
static size_t right(size_t i, size_t height) noexcept { return i + (1u << (height - 1)); }
static size_t left(size_t i, size_t /*height*/) noexcept { return i + 1; }
static size_t right(size_t i, size_t height) noexcept {
return i + (size_t(1) << (height - 1));
}
// this builds the depth-first binary tree array top down (post-order)
template<typename Leaf, typename Node>