tabula is a header-only C++23 library for representing board-game grids, squares, and board embeddings. It aims to provide portable, compile-time building blocks for board representations and common chess, draughts, and Stratego layouts without requiring experimental language features.
tabula isn't published to a package registry, so the default way to add it is FetchContent, which needs no separate install step:
include(FetchContent)
FetchContent_Declare(
tabula
GIT_REPOSITORY https://github.com/rhalbersma/tabula.git
GIT_TAG main # or a release tag
)
FetchContent_MakeAvailable(tabula)
target_link_libraries(my_target PRIVATE tabula::tabula)If you've already installed tabula yourself (e.g. cmake --install, or your own package manager integration), use find_package instead:
find_package(tabula 0.1.0 CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE tabula::tabula)If you vendor the source directly (e.g. a git submodule), use add_subdirectory (tabula's own tests and their Boost.Test dependency are only built when tabula is the top-level project, so nothing needs to be disabled):
add_subdirectory(external/tabula)
target_link_libraries(my_target PRIVATE tabula::tabula)The target publishes the public headers and requires C++23. You can include individual headers directly, such as <tabula/board.hpp> or <tabula/games/chess.hpp>.
This single-header library has no other dependencies than the C++ Standard Library and is continuously tested with the following conforming C++23 compilers, against all three mainstream standard libraries (libstdc++, the MSVC STL, and libc++). Following the model of apt.llvm.org, we support the latest two stable releases of each compiler, plus its current development branch. Every table leg is required except the MSVC 2026 and 2026-Preview legs, which are intentionally allowed to fail while the runner image lacks the upstream compiler fix.
MSVC currently fails outright on an ambiguous partial-specialization bug (basic_compass<chequer{...}>), reported fixed upstream in VS 18.7.0 per Microsoft's own tracker but not independently verified - Compiler Explorer's msvc-latest is still on the 18.6 line (_MSC_VER 1951), so there's no publicly reachable 18.7.0 build to confirm it yet - and not present on GitHub Actions' runner image either (actions/runner-images#14130 tracks a bump to 18.6.x, still short of 18.7.0). MSVC is not a required PR status check, so this failure is visible but doesn't block merging.
Note that the unit tests depend on Boost.
Special thanks to Fabien Letouzey for a very fruitful exchange of ideas.
Copyright Rein Halbersma 2019-2026. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)