This quickstart walks you through a single, self-contained program that exercises every ASTD module — math, fraction, and time — so you can see real function signatures, construction patterns, and expected output before diving into the individual API references. If you have not yet copied 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.
astd/ directory into your project, complete the Installation guide first.
Include the umbrella header
One
#include is all you need to bring every ASTD module into scope. Add it at the top of your source file alongside the standard headers your program uses directly.astd.hpp transitively includes:astd/math/math.hpp→ re-exportscppmath.hpp(free math functions) andfraction.hpp(thefraction<T,U>class)astd/time/time.hpp→ theastd::getSystemTimeandastd::getSystemTrimmedTimefunctions
Use the math functions
The math module provides three free functions, all defined with abbreviated function templates so they accept any numeric type without explicit instantiation.Expected output
power() returns an int literal 1 for non-positive exponents regardless of the base type. Keep this in mind if you need floating-point results for edge cases.Work with fractions
fraction<T, U> is a class template where T is the numerator type and U is the denominator type. Construct it with a numerator and denominator value. Passing 0 as the denominator throws std::exception("Undefined fraction").The compound operators (
+=, -=, *=) modify the left-hand fraction in place and do not simplify the result to lowest terms. For example, 1/3 + 1/6 produces 3/6 rather than 1/2. Reduction is left to the caller.Retrieve the system time
Both time functions live in the Example output (values will reflect the time of execution)
astd namespace and wrap std::chrono. Each accepts an optional bool local parameter that defaults to false (UTC). Pass true to get the local time zone instead.getSystemTrimmedTime() uses std::chrono::time_point_cast<std::chrono::seconds> to strip sub-second precision. Use it when you need human-readable timestamps without microsecond noise, such as for log entries or user-facing display strings.Next steps
Math API Reference
Full reference for
power(), square(), getNumType(), and every member
of the fraction<T,U> class template.Installation
Missed a step? Revisit the full installation guide covering GitHub Releases,
git clone, and compiler flags.