Single Source of Truth
Mr.Docs turns the documentation comments that live next to your C++ declarations into authoritative reference pages. One source of truth—your code.
Mr.Docs turns the documentation comments that live next to your C++ declarations into authoritative reference pages. One source of truth—your code.
Mr.Docs models C++ accurately: overload sets, concepts and constraints, deduced return types, aliases, constants, SFINAE, inherited and hidden members, algorithm function objects, and more.
Export to any output format and extend it with your own generator plugins.
Highly configurable: control output format and theme, tailor symbol selection, and tune generation to match your project’s standards.
Attributes & Specifiers
Accurate rendering of attributes and exception specifications (e.g. [[noreturn]], noexcept).
/** Exit the program.
The program will end immediately.
@note Functions registered with `std::atexit` are not invoked.
*/
[[noreturn]]
void
terminate() noexcept;
Exit the program.
Declared in <terminate.hpp>
[[noreturn]]
void
terminate() noexcept;
The program will end immediately.
Functions registered with std::atexit are not invoked.
This function does not return.
Parameters & Returns
Documentation comments become structured reference pages—synopsis, description, parameters, and returns.
/** Return the distance between two points
This function returns the distance between two points
according to the Euclidean distance formula.
@param x0 The x-coordinate of the first point
@param y0 The y-coordinate of the first point
@param x1 The x-coordinate of the second point
@param y1 The y-coordinate of the second point
@return The distance between the two points
*/
double
distance(double x0, double y0, double x1, double y1);
Return the distance between two points
Declared in <distance.hpp>
double
distance(
double x0,
double y0,
double x1,
double y1);
This function returns the distance between two points according to the Euclidean distance formula.
The distance between the two points
| Name | Description |
|---|---|
| x0 | The x-coordinate of the first point |
| y0 | The y-coordinate of the first point |
| x1 | The x-coordinate of the second point |
| y1 | The y-coordinate of the second point |
Directives & Semantics
Use directives to capture semantics beyond the signature.
/** Return true if a number is prime.
@par Complexity
Linear in n.
@return Whether `n` is prime.
@param n The number to test
*/
bool
is_prime(unsigned long long n) noexcept;
Return true if a number is prime.
Declared in <is_prime.hpp>
bool
is_prime(unsigned long long n) noexcept;
Linear in n.
Whether n is prime.
| Name | Description |
|---|---|
| n | The number to test |
Templates & SFINAE
Understands concepts, constraints, and SFINAE—rendered as you wrote them.
#include <type_traits>
/** Computes the integer square root \f$\lfloor\sqrt{value}\rfloor\f$.
This function calculates the square root of a given integral value
using bit manipulation, in $O(\log value)$ time.
@throws std::invalid_argument if the input value is negative.
@tparam T The type of the input value. Must be an integral type.
@param value The integral value to compute the square root of.
@return The square root of the input value.
*/
template <typename T>
std::enable_if_t<std::is_integral_v<T>, T> sqrt(T value);
Computes the integer square root \(\lfloor\sqrt{value}\rfloor\).
Declared in <sqrt.hpp>
template<typename T>
T
sqrt(T value)
requires std::is_integral_v<T>;
This function calculates the square root of a given integral value using bit manipulation, in \(O(\log value)\) time.
| Name | Thrown on |
|---|---|
std::invalid_argument | if the input value is negative. |
The square root of the input value.
| Name | Description |
|---|---|
| T | The type of the input value. Must be an integral type. |
| Name | Description |
|---|---|
| value | The integral value to compute the square root of. |
Function Objects
Function objects are documented as callable entities—operator() parameter list and return type appear directly on the variable.
struct abs_fn
{
/** Compute the absolute value.
@param x The input value.
@return The absolute value of x.
*/
double
operator()(double x) const noexcept;
};
/** Return the absolute value of a number. */
constexpr abs_fn abs = {};
Compute the absolute value.
Declared in <function_object.hpp>
double
abs(double x) noexcept;
This function is defined as an Algorithm Function Object (AFO).
The absolute value of x.
| Name | Description |
|---|---|
| x | The input value. |
Action Time
Install Mr.Docs and generate your first reference site in minutes. No excuses.