ASTD (Artemis Standard Library Extension) is a lightweight, header-only C++ library designed to complement the standard library for projects built within the Artemis ecosystem. Because every component ships as a plain header file, integrating ASTD requires nothing more than copying a single directory into your project — no build system configuration, no compiled binaries, and no dependency managers. Just include and go.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.
Why header-only?
Header-only libraries eliminate the friction that typically accompanies C++ dependencies. There is no separate compile step, no static or shared library to link against, and no ABI compatibility matrix to worry about. You copy theastd/ directory into your project tree, add one #include, and ASTD is ready. This also means ASTD travels with your source code: drop it into version control and every contributor gets the same library automatically.
ASTD requires a C++20-compliant compiler. The library relies on
std::lcm from <numeric> and time-zone support from <chrono>, both of which are C++20 features. Use -std=c++20 (GCC/Clang) or /std:c++20 (MSVC) when compiling.Modules
ASTD is organised into three focused modules. You can pull in every module at once with the umbrella header, or include only what your project needs.Math
The math module (astd/math/math.hpp) provides three free functions for everyday arithmetic:
power(base, exponent)— raisesbasetoexponentusing integer iteration, returning1when the exponent is zero or negative.square(base)— returnsbase * base, a concise shorthand for squaring any numeric value.getNumType(num)— returnstrueifnumis even,falseif it is odd.
const auto), so they work with any numeric type without explicit specialisation.
Fraction
The fraction module (astd/math/fraction.hpp) provides a fraction<T, U> class template for exact rational arithmetic. Numerator and denominator types are independently parameterised, giving you precise control over the underlying storage. Supported operations include addition, subtraction, and multiplication via compound-assignment operators, a streaming operator<< that prints in numerator/denominator form, and fractionToDecimal() for converting to a double. Constructing a fraction with a zero denominator throws std::exception with the message "Undefined fraction".
Time
The time module (astd/time/time.hpp) lives in the astd namespace and wraps std::chrono to provide two convenience functions:
astd::getSystemTime(bool local = false)— returns the current system clock time. Passtrueto receive a local-zone time point instead of UTC.astd::getSystemTrimmedTime(bool local = false)— same as above, but the result is truncated to whole seconds viastd::chrono::time_point_cast<std::chrono::seconds>, removing sub-second noise.
Umbrella include
astd/math/math.hpp (which re-exports the math and fraction headers) and astd/time/time.hpp. It is the recommended default for new projects. Individual headers can be included directly when compile-time granularity matters.
License
ASTD is released under the MIT License. The source code is hosted on GitHub at github.com/X-ARTEMIS/ASTD.Explore ASTD
Installation
Download or clone ASTD, copy the headers into your project, and set the
correct C++20 compiler flag — up and running in minutes.
Quickstart
A complete working example that exercises all three modules: math, fraction,
and time — with expected output for every call.
Math API Reference
Detailed reference for
power(), square(), getNumType(), and the
fraction<T,U> class template.Versioning Guide
Learn how ASTD follows semantic versioning (major.minor.patch) and what each
version tier signals about the scope of a change.