1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
puzzle-wuzzle-generator/include/utilities.hpp

19 lines
408 B
C++

#pragma once
#include <array>
// Simple static vector (much faster)
// Also slightly faster than boost::container::static_vector
// No checking is performed!
template <typename T, size_t Max>
struct small_vector{
std::array<T, Max> arr;
size_t elements = 0;
void push_back(T const & t){
arr[elements++] = t;
}
auto begin() const { return &arr[0]; }
auto end() const { return &arr[elements]; }
};