ASTD is an open source project licensed under the MIT License, and contributions of all shapes are welcome — whether you are fixing a bug in an existing function, adding a handy new helper to theDocumentation 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.
math module, or proposing an entirely new module. Because ASTD is a header-only library with no build system, the barrier to entry is low: everything lives in .hpp files that you can edit directly with any text editor or IDE.
Repository Structure
Before making changes it helps to understand how the repository is laid out:astd/astd.hpp is a convenience header that includes every module:
#include "astd/astd.hpp".
Code Style
ASTD is written in C++20 and uses modern C++ idioms throughout. Match the style of the surrounding code when contributing:Auto Parameters
Free functions use abbreviated function templates (
auto parameters) rather than explicit template<typename T> declarations where possible.Template Classes
Data types like
fraction<T, U> use explicit template parameters, keeping the types transparent to the caller.std::chrono
The time module leans on
std::chrono including time zones (std::chrono::current_zone()) available in C++20.Standard Library
Prefer standard library utilities —
std::lcm from <numeric>, std::chrono from <chrono> — over third-party dependencies.astd/math/cppmath.hpp:
Types of Contribution and Their Version Impact
Every change you make maps to exactly one tier of ASTD’s semantic versioning policy. Understanding which tier your change falls into helps reviewers merge it with the correct version bump:| Contribution type | Version bump | Example |
|---|---|---|
| Fix a bug in an existing function | Patch | Correcting an edge case in power() |
| Add a new function to an existing module | Minor | Adding a clamp() function to astd/math/ |
| Introduce a new module/library | Major | Creating a new astd/string/ module |
You do not need to update version numbers yourself — maintainers handle that when tagging a release. Simply describe in your pull request description what kind of change you are making so the right bump can be applied.
How to Contribute
Fork and clone the repository
Fork X-ARTEMIS/ASTD on GitHub, then clone your fork locally:
Make your changes
Edit the appropriate
.hpp file or create a new module directory. See the sections below for details on each scenario.Write or update tests
Add assertions to the relevant file in Compile and run your test to verify correctness before pushing.
tests/. The existing tests/math.cpp shows the pattern:Open a pull request
Push your branch to your fork and open a pull request against the
main branch of X-ARTEMIS/ASTD. Include a brief description of what you changed and which version bump tier it falls into.Adding a Function to an Existing Module
This is a minor change. Find the appropriate.hpp file and add your function following the existing style.
Example — adding to the math module:
Open astd/math/cppmath.hpp and add your function alongside the existing ones:
tests/math.cpp:
The
astd/math/math.hpp file is a convenience header that includes cppmath.hpp and fraction.hpp. You do not need to touch it unless you are adding a brand-new .hpp file to the math directory.Adding a New Module
This is a major change. Creating a wholly new module expands ASTD’s scope and requires updates in two places: 1. Create the module directory and header:namespace astd { ... } convention used in astd/time/time.hpp to keep your symbols scoped:
astd/astd.hpp and add an include for your new module:
tests/yourmodule.cpp mirroring the structure of tests/math.cpp:
Frequently Asked Questions
Do I need a build system to test my changes?
Do I need a build system to test my changes?
No. ASTD has no build system. Compile your test file directly with a C++20-capable compiler. For example, with g++:Replace
math with your module name as appropriate.What C++ standard should I target?
What C++ standard should I target?
C++20. The existing codebase uses C++20 features including abbreviated function templates (
auto parameters), std::chrono time zones, and std::lcm. Your contributions should compile cleanly under -std=c++20.My contribution fixes a bug — do I need to add a new test?
My contribution fixes a bug — do I need to add a new test?
Yes, whenever possible. Add an assertion in the relevant
tests/ file that reproduces the bug (and passes after your fix). This prevents regressions in future patches.How do I add to the fraction class?
How do I add to the fraction class?
The
fraction<T, U> template class lives in astd/math/fraction.hpp. New methods go inside the class body; new free-function operators go after the class definition, following the existing operator+, operator-, operator*, and operator<< patterns already in the file.