Skip to content

rhalbersma/tabula

Repository files navigation

Board game utilities

Language Standard License GCC MinGW Clang Clang-libc++ Apple Clang Clang-CL MSVC Coverage OpenSSF Scorecard

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.

Using tabula

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>.

Requirements

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.

Platform Compiler Standard Library Older stable Latest stable Trunk / Preview Build
Linux GCC libstdc++ 15 16 17-SVN GCC
Windows MinGW libstdc++ 15 16 17-SVN MinGW
Linux Clang libstdc++ 21 (libstdc++ 15) 22 (libstdc++ 16) 23-SVN (libstdc++ 17-SVN) Clang
Linux Clang libc++ 21 22 23-SVN Clang-libc++
macOS Apple Clang libc++ 17.0.0 (Xcode 16.4) 21.0.0 (Xcode 26.6) Apple Clang
Windows Clang-CL MSVC 19.1.5 (VS 2022) 20.1.8 (VS 2026) 20.1.8 (VS 2026-Preview) Clang-CL
Windows MSVC MSVC 2026 2026-Preview MSVC

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.

Acknowledgments

Special thanks to Fabien Letouzey for a very fruitful exchange of ideas.

License

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)

Releases

Packages

Used by

Contributors

Languages