Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/X-ARTEMIS/ASTD/llms.txt

Use this file to discover all available pages before exploring further.

Because ASTD is header-only, installation is simply a matter of getting the astd/ directory onto your filesystem and telling your compiler where to find it. There are no libraries to link, no package manager to configure, and no generated files to maintain. The two sections below cover the two ways to obtain the headers: a GitHub Releases download (best for pinning a specific version) and a git clone (best for tracking the latest commits).

Choose your installation method

1

Download the latest release archive

Navigate to the ASTD releases page and download the source archive (.zip or .tar.gz) for the version you want to pin.
2

Extract the archive

Unzip or untar the downloaded file. You will see a top-level directory containing the astd/ folder alongside the README and any other project files.
# Example for a .zip download
unzip ASTD-1.0.0.zip
3

Copy the astd/ directory into your project

Move or copy the astd/ directory to the root of your own project (or any directory on your include path).
cp -r ASTD-1.0.0/astd/ ./your-project/astd/
Your project tree should look like this:
your-project/
├── astd/
│   ├── astd.hpp
│   ├── math/
│   │   ├── math.hpp
│   │   ├── cppmath.hpp
│   │   └── fraction.hpp
│   └── time/
│       └── time.hpp
└── main.cpp
4

Add the include and compile with C++20

Add the umbrella include at the top of your source file and compile with the C++20 flag for your toolchain (see the Compiler flags section below).
#include "astd/astd.hpp"

Umbrella vs. individual headers

The astd/astd.hpp umbrella header is the simplest way to use the library — it pulls in every module with a single line:
#include "astd/astd.hpp"
If you only need one module and want to minimise what the preprocessor sees, you can include headers individually:
// astd/math/math.hpp re-exports both cppmath.hpp and fraction.hpp
#include "astd/math/math.hpp"

Compiler flags

ASTD uses std::lcm (from <numeric>) and std::chrono time-zone support, both of which require C++20. Set the appropriate flag for your toolchain:
g++ -std=c++20 -I. main.cpp -o main
The -I. flag tells GCC to search the current directory for headers, so #include "astd/astd.hpp" resolves correctly when astd/ sits at the project root.
Compiling with C++17 or earlier will cause errors in both fraction.hpp (which uses std::lcm from <numeric>) and time.hpp (which uses std::chrono::current_zone()). Always ensure your project-wide C++ standard is set to C++20 or later.

Verify your installation

Create a main.cpp at your project root with the following content and compile it. A successful build with no errors confirms that ASTD headers are found and that your compiler is in C++20 mode.
#include "astd/astd.hpp"
#include <iostream>

int main() {
    // Math
    std::cout << "2^8 = " << power(2, 8) << "\n";

    // Fraction
    fraction<int, int> f{3, 4};
    std::cout << "3/4 as decimal = " << f.fractionToDecimal() << "\n";

    // Time
    std::cout << "UTC time: " << astd::getSystemTrimmedTime() << "\n";

    return 0;
}
If the program compiles and prints output, ASTD is correctly installed. Head over to the Quickstart guide for a deeper walkthrough of every module.

Build docs developers (and LLMs) love