Skip to content

Commit

Permalink
Convert html links to code links
Browse files Browse the repository at this point in the history
  • Loading branch information
danakj committed Sep 1, 2023
1 parent 74e6ccd commit 525e4d5
Show file tree
Hide file tree
Showing 19 changed files with 510 additions and 508 deletions.
2 changes: 1 addition & 1 deletion sus/collections/collections.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace sus {
///
/// The Subspace library provides implementations of common general purpose
/// programming data structures, with rich APIs that allow for interactions with
/// [Iterators](sus-iter.html), and with APIs that provide safe defaults.
/// [Iterators]($sus::iter), and with APIs that provide safe defaults.
///
/// The collections offer similar functionality to the [C++ standard containers
/// library](https://en.cppreference.com/w/cpp/container) but differ in some
Expand Down
2 changes: 1 addition & 1 deletion sus/collections/iterators/drain.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace sus::collections {
/// d1 = sus::move(d2); // Points at v2, is destroyed after v2.
/// ```
///
/// While Drain is satisfies [`Move`](sus-mem-Move.html) in order to be
/// While Drain is satisfies [`Move`]($sus::mem::Move) in order to be
/// move-constructed, it will panic on move-assignment.
template <class ItemT>
struct [[nodiscard]] Drain final
Expand Down
6 changes: 3 additions & 3 deletions sus/iter/__private/iter_compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace sus::iter::__private {

/// Compares two iterators element-wise using the given function.
///
/// Isolates the logic shared by [`cmp_by`](sus-iter-IteratorBase.html#method.cmp_by),
/// [`partial_cmp_by`](sus-iter-IteratorBase.html#method.partial_cmp_by), and
/// [`weak_cmp_by`](sus-iter-IteratorBase.html#method.weak_cmp_by).
/// Isolates the logic shared by [`cmp_by`]($sus::iter::IteratorBase::cmp_by),
/// [`partial_cmp_by`]($sus::iter::IteratorBase::partial_cmp_by), and
/// [`weak_cmp_by`]($sus::iter::IteratorBase::weak_cmp_by).
template <class Ordering, class ItemA, class ItemB>
constexpr inline Ordering iter_compare(
::sus::iter::Iterator<ItemA> auto&& a,
Expand Down
6 changes: 3 additions & 3 deletions sus/iter/compat_ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ namespace sus::iter {
template <class R, class B, class E, class ItemT>
class IteratorOverRange;

/// Constructs an [`Iterator`](sus-iter-Iterator.html) from a
/// Constructs an [`Iterator`]($sus::iter::Iterator) from a
/// [`std::ranges::input_range`](https://en.cppreference.com/w/cpp/ranges/input_range).
///
/// If the input is an lvalue reference, the `Iterator` will also
/// iterate over references to the range's values. If the input is const, the
/// `Iterator` will iterate over const references. To iterate over values
/// instead, use [`Iterator::cloned`](sus-iter-IteratorBase.html#method.cloned) or
/// [`Iterator::copied`](sus-iter-IteratorBase.html#method.copied).
/// instead, use [`Iterator::cloned`]($sus::iter::IteratorBase::cloned) or
/// [`Iterator::copied`]($sus::iter::IteratorBase::copied).
///
/// If the input is an rvalue refernce, the `Iterator` will iterate over the
/// moved items from the range.
Expand Down
28 changes: 14 additions & 14 deletions sus/iter/iterator_defn.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ class IteratorBase {
constexpr Iterator<std::remove_cvref_t<Item>> auto cloned() && noexcept
requires(::sus::mem::Clone<Item>);

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another.
template <IntoIteratorAny Other, int&...,
class OtherItem = typename IntoIteratorOutputType<Other>::Item>
requires(::sus::ops::Ord<ItemT, OtherItem>)
constexpr std::weak_ordering cmp(Other&& other) && noexcept;

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another with
/// respect to the specified comparison function.
template <IntoIteratorAny Other, int&...,
Expand Down Expand Up @@ -390,15 +390,15 @@ class IteratorBase {
Iterator<GenR> auto generate(GenFn generator_fn) && noexcept;

/// Determines if the elements of this Iterator are
/// [lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// greater than or equal to those of another.
template <IntoIteratorAny Other, int&...,
class OtherItem = typename IntoIteratorOutputType<Other>::Item>
requires(::sus::ops::PartialOrd<ItemT, OtherItem>)
constexpr bool ge(Other&& other) && noexcept;

/// Determines if the elements of this Iterator are
/// [lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// greater than those of another.
template <IntoIteratorAny Other, int&...,
class OtherItem = typename IntoIteratorOutputType<Other>::Item>
Expand Down Expand Up @@ -438,15 +438,15 @@ class IteratorBase {
const std::remove_reference_t<Item>&)> auto compare) noexcept;

/// Determines if the elements of this Iterator are
/// [lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// less than or equal to those of another.
template <IntoIteratorAny Other, int&...,
class OtherItem = typename IntoIteratorOutputType<Other>::Item>
requires(::sus::ops::PartialOrd<ItemT, OtherItem>)
constexpr bool le(Other&& other) && noexcept;

/// Determines if the elements of this Iterator are
/// [lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// less than those of another.
template <IntoIteratorAny Other, int&...,
class OtherItem = typename IntoIteratorOutputType<Other>::Item>
Expand Down Expand Up @@ -612,7 +612,7 @@ class IteratorBase {
constexpr Option<Item> nth_back(usize n) noexcept
requires(DoubleEndedIterator<Iter, Item>);

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another.
///
/// The comparison works like short-circuit evaluation, returning a result
Expand All @@ -626,7 +626,7 @@ class IteratorBase {
requires(::sus::ops::PartialOrd<ItemT, OtherItem>)
constexpr std::partial_ordering partial_cmp(Other&& other) && noexcept;

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another with
/// respect to the specified comparison function.
template <IntoIteratorAny Other, int&...,
Expand Down Expand Up @@ -777,7 +777,7 @@ class IteratorBase {
/// value, starting from the back.
///
/// This is the reverse version of
/// [`Iterator::fold()`](sus-iter-IteratorBase.html#method.fold): it takes
/// [`Iterator::fold()`]($sus::iter::IteratorBase::fold): it takes
/// elements starting from the back of the iterator.
///
/// `rfold()` takes two arguments: an initial value, and a closure with two
Expand All @@ -799,7 +799,7 @@ class IteratorBase {
/// associative operators like `+`, the order the elements are combined in is
/// not important, but for non-associative operators like `-` the order will
/// affect the final result. For a left-associative version of `rfold()`, see
/// [`Iterator::fold()`](sus-iter-IteratorBase.html#method.fold).
/// [`Iterator::fold()`]($sus::iter::IteratorBase::fold).
template <class B, ::sus::fn::FnMut<::sus::fn::NonVoid(B, ItemT)> F>
requires(DoubleEndedIterator<Iter, ItemT> &&
std::convertible_to<std::invoke_result_t<F&, B &&, ItemT &&>, B> &&
Expand Down Expand Up @@ -887,7 +887,7 @@ class IteratorBase {
/// of 1 returns every element.
constexpr Iterator<Item> auto step_by(usize step) && noexcept;

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another.
///
/// Strong ordering requires each item being compared that compares equal to
Expand All @@ -903,7 +903,7 @@ class IteratorBase {
requires(::sus::ops::StrongOrd<ItemT, OtherItem>)
constexpr std::strong_ordering strong_cmp(Other&& other) && noexcept;

/// [Lexicographically](sus-ops-Ord.html#how-can-i-implement-ord?)
/// [Lexicographically]($sus::ops::Ord#how-can-i-implement-ord?)
/// compares the elements of this `Iterator` with those of another with
/// respect to the specified comparison function.
template <IntoIteratorAny Other, int&...,
Expand Down Expand Up @@ -990,7 +990,7 @@ class IteratorBase {
/// auto v = sus::move(u).into_iter().try_collect<Vec<i32>>();
/// sus::check(v == none());
/// ```
/// A similar example, but with [`Result`](sus-result-Result.html):
/// A similar example, but with [`Result`]($sus::result::Result):
/// ```
/// enum Error { ERROR };
/// auto u = Vec<Result<i32, Error>>(ok(1), ok(2), ok(3));
Expand Down Expand Up @@ -1027,7 +1027,7 @@ class IteratorBase {
constexpr R try_fold(B init, F f) noexcept;

/// This is the reverse version of
/// [`Iterator::try_fold()`](sus-iter-IteratorBase.html#method.try_fold): it
/// [`Iterator::try_fold()`]($sus::iter::IteratorBase::try_fold): it
/// takes elements starting from the back of the iterator.
template <class B, ::sus::fn::FnMut<::sus::fn::NonVoid(B, ItemT)> F, int&...,
class R = std::invoke_result_t<F&, B&&, ItemT&&>>
Expand Down
2 changes: 1 addition & 1 deletion sus/iter/repeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Repeat;
/// The `repeat()` function repeats a single value over and over again.
///
/// Infinite iterators like `repeat()` are often used with adapters like
/// [`Iterator::take()`](sus-iter-IteratorBase.html#method.take), in order to make them
/// [`Iterator::take()`]($sus::iter::IteratorBase::take), in order to make them
/// finite.
///
/// If the element type of the iterator you need does not implement `Clone`, or
Expand Down
4 changes: 2 additions & 2 deletions sus/iter/repeat_with.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class RepeatWith;
/// The `repeat_with()` function calls the repeater over and over again.
///
/// Infinite iterators like `repeat_with()` are often used with adapters like
/// [`Iterator::take()`](sus-iter-IteratorBase.html#method.take), in order to make them
/// [`Iterator::take()`]($sus::iter::IteratorBase::take), in order to make them
/// finite.
///
/// If the element type of the iterator you need implements `Clone`, and it is
/// OK to keep the source element in memory, you should instead use the
/// [`repeat()`](sus-iter-fn.repeat.html) function.
/// [`repeat()`]($sus::iter::repeat) function.
///
/// # Exampler
/// ```
Expand Down
62 changes: 31 additions & 31 deletions sus/num/__private/float_methods.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ _primitive primitive_value = _primitive{0.0};
static const _primitive MIN_PRIMITIVE;
/// Largest finite primitive value.
static const _primitive MAX_PRIMITIVE;
/// Smallest finite [`@doc.self`](sus-num-@doc.self.html).
/// Smallest finite [`@doc.self`]($sus::num::@doc.self).
static const _self MIN;
/// Largest finite [`@doc.self`](sus-num-@doc.self.html).
/// Largest finite [`@doc.self`]($sus::num::@doc.self).
static const _self MAX;
/// The radix or base of the internal representation of
/// [`@doc.self`](sus-num-@doc.self.html).
/// [`@doc.self`]($sus::num::@doc.self).
static const u32 RADIX;
/// Approximate number of significant digits in base 2.
static const u32 MANTISSA_DIGITS;
/// Approximate number of significant digits in base 10.
static const u32 DIGITS;
/// Machine epsilon value for [`@doc.self`](sus-num-@doc.self.html).
/// Machine epsilon value for [`@doc.self`]($sus::num::@doc.self).
///
/// This is the difference between 1.0 and the next larger representable
/// number.
static const _self EPSILON;
/// Smallest positive normal [`@doc.self`](sus-num-@doc.self.html) value.
/// Smallest positive normal [`@doc.self`]($sus::num::@doc.self) value.
static const _self MIN_POSITIVE;
/// One greater than the minimum possible normal power of 2 exponent.
static const i32 MIN_EXP;
Expand Down Expand Up @@ -123,7 +123,7 @@ struct consts {

/// Default constructor, which sets the value to 0.
///
/// Satisfies the [`Default`](sus-construct-Default.html) concept.
/// Satisfies the [`Default`]($sus::construct::Default) concept.
///
/// #[doc.overloads=ctor.default]
constexpr inline _self() noexcept = default;
Expand Down Expand Up @@ -180,14 +180,14 @@ constexpr inline _self& operator=(P v) noexcept {
return *this;
}

/// Constructs a [`@doc.self `](sus-num-@doc.self.html) from an
/// [`Iterator`](sus-iter-Iterator.html) by computing the sum of all elements in
/// Constructs a [`@doc.self `]($sus::num::@doc.self) from an
/// [`Iterator`]($sus::iter::Iterator) by computing the sum of all elements in
/// the iterator.
///
/// This method should rarely be called directly, as it is used to satisfy the
/// [`Sum`](sus-iter-Sum.html) concept so that
/// [`Iterator::sum()`](sus-iter-IteratorBase.html#method.sum) can be called for
/// iterators over [`@doc.self `](sus-num-@doc.self.html).
/// [`Sum`]($sus::iter::Sum) concept so that
/// [`Iterator::sum()`]($sus::iter::IteratorBase#sum) can be called for
/// iterators over [`@doc.self `]($sus::num::@doc.self).
static constexpr _self from_sum(::sus::iter::Iterator<_self> auto&& it) noexcept
requires(::sus::mem::IsMoveRef<decltype(it)>)
{
Expand All @@ -196,13 +196,13 @@ static constexpr _self from_sum(::sus::iter::Iterator<_self> auto&& it) noexcept
return p;
}

/// Constructs a [`@doc.self `](sus-num-@doc.self.html) from an `Iterator` by
/// Constructs a [`@doc.self `]($sus::num::@doc.self) from an `Iterator` by
/// computing the product of all elements in the iterator.
///
/// This method should rarely be called directly, as it is used to satisfy the
/// [`Product`](sus-iter-Product.html) concept so that
/// [`Iterator::product()`](sus-iter-IteratorBase.html#method.product) can be
/// called for iterators over [`@doc.self `](sus-num-@doc.self.html).
/// [`Product`]($sus::iter::Product) concept so that
/// [`Iterator::product()`]($sus::iter::IteratorBase#product) can be
/// called for iterators over [`@doc.self `]($sus::num::@doc.self).
static constexpr _self from_product(
::sus::iter::Iterator<_self> auto&& it) noexcept
requires(::sus::mem::IsMoveRef<decltype(it)>)
Expand All @@ -215,7 +215,7 @@ static constexpr _self from_product(
/// Conversion from the numeric type to a C++ primitive type.
///
/// This converts to floating point primitives which are at least as large as
/// the [`@doc.self`](sus-num-@doc.self.html).
/// the [`@doc.self`]($sus::num::@doc.self).
///
/// ```
/// auto d = double{3_f64}; // Compiles.
Expand All @@ -228,7 +228,7 @@ static constexpr _self from_product(
/// ```
///
/// Potentially-lossy type conversions can be forced through the
/// [`Transmogrify`](sus-construct-Transmogrify.html) concept, such as
/// [`Transmogrify`]($sus::construct::Transmogrify) concept, such as
/// `sus::mog<float>(3_f64)` or `sus::mog<f32>(3_f64)`.
template <PrimitiveFloat U>
requires(::sus::mem::size_of<U>() >= ::sus::mem::size_of<_primitive>())
Expand Down Expand Up @@ -292,8 +292,8 @@ operator<=>(_self l, PrimitiveFloat auto r) noexcept {
/// positive quiet NaN.
///
/// The ordering established by this function does not always agree with the
/// [`PartialOrd`](sus-ops-PartialOrd.html) and [`Eq`](sus-ops-Eq.html)
/// implementations of [`@doc.self`](sus-num-@doc.self.html). For example, they
/// [`PartialOrd`]($sus::ops::PartialOrd) and [`Eq`]($sus::ops::Eq)
/// implementations of [`@doc.self`]($sus::num::@doc.self). For example, they
/// consider negative and positive zero equal, while
/// [`total_cmp`](#method.total_cmp) doesn't.
///
Expand All @@ -305,19 +305,19 @@ operator<=>(_self l, PrimitiveFloat auto r) noexcept {
///
/// This method returns
/// [`std::weak_ordering`](https://en.cppreference.com/w/cpp/utility/compare/weak_ordering)
/// which can be used in situations that require [`Ord`](sus-ops-Ord.html)
/// which can be used in situations that require [`Ord`]($sus::ops::Ord)
/// because different NaNs will be ordered equivalently.
sus_pure constexpr std::weak_ordering total_cmp(_self other) const& noexcept {
return __private::float_strong_ordering(primitive_value,
other.primitive_value);
}

/// Satisfies the [`Neg<@doc.self>`](sus-num-Neg.html) concept.
/// Satisfies the [`Neg<@doc.self>`]($sus::num::Neg) concept.
sus_pure constexpr inline _self operator-() const {
return _self(-primitive_value);
}

/// Satisfies the [`Add<@doc.self>`](sus-num-Add.html) concept.
/// Satisfies the [`Add<@doc.self>`]($sus::num::Add) concept.
/// #[doc.overloads=float.+]
[[nodiscard]] sus_pure friend constexpr inline _self operator+(
_self l, _self r) noexcept {
Expand Down Expand Up @@ -345,7 +345,7 @@ friend constexpr inline _self operator+(_self l, U r) noexcept = delete;
template <PrimitiveFloat U>
requires(!std::convertible_to<U, _self>)
friend constexpr inline _self operator+(U l, _self r) noexcept = delete;
/// Satisfies the [`Sub<@doc.self>`](sus-num-Sub.html) concept.
/// Satisfies the [`Sub<@doc.self>`]($sus::num::Sub) concept.
/// #[doc.overloads=float.-]
[[nodiscard]] sus_pure friend constexpr inline _self operator-(
_self l, _self r) noexcept {
Expand Down Expand Up @@ -373,7 +373,7 @@ friend constexpr inline _self operator-(_self l, U r) noexcept = delete;
template <PrimitiveFloat U>
requires(!std::convertible_to<U, _self>)
friend constexpr inline _self operator-(U l, _self r) noexcept = delete;
/// Satisfies the [`Mul<@doc.self>`](sus-num-Mul.html) concept.
/// Satisfies the [`Mul<@doc.self>`]($sus::num::Mul) concept.
/// #[doc.overloads=float.*]
[[nodiscard]] sus_pure friend constexpr inline _self operator*(
_self l, _self r) noexcept {
Expand Down Expand Up @@ -401,7 +401,7 @@ friend constexpr inline _self operator*(_self l, U r) noexcept = delete;
template <PrimitiveFloat U>
requires(!std::convertible_to<U, _self>)
friend constexpr inline _self operator*(U l, _self r) noexcept = delete;
/// Satisfies the [`Div<@doc.self>`](sus-num-Div.html) concept.
/// Satisfies the [`Div<@doc.self>`]($sus::num::Div) concept.
/// #[doc.overloads=float./]
[[nodiscard]] sus_pure friend constexpr inline _self operator/(
_self l, _self r) noexcept {
Expand Down Expand Up @@ -429,7 +429,7 @@ friend constexpr inline _self operator/(_self l, U r) noexcept = delete;
template <PrimitiveFloat U>
requires(!std::convertible_to<U, _self>)
friend constexpr inline _self operator/(U l, _self r) noexcept = delete;
/// Satisfies the [`Rem<@doc.self>`](sus-num-Rem.html) concept.
/// Satisfies the [`Rem<@doc.self>`]($sus::num::Rem) concept.
///
/// The remainder from the division of two floats.
///
Expand Down Expand Up @@ -466,23 +466,23 @@ template <PrimitiveFloat U>
requires(!std::convertible_to<U, _self>)
friend constexpr inline _self operator%(U l, _self r) noexcept = delete;

/// Satisfies the [`AddAssign<@doc.self>`](sus-num-AddAssign.html) concept.
/// Satisfies the [`AddAssign<@doc.self>`]($sus::num::AddAssign) concept.
constexpr inline void operator+=(_self r) & noexcept {
primitive_value += r.primitive_value;
}
/// Satisfies the [`SubAssign<@doc.self>`](sus-num-SubAssign.html) concept.
/// Satisfies the [`SubAssign<@doc.self>`]($sus::num::SubAssign) concept.
constexpr inline void operator-=(_self r) & noexcept {
primitive_value -= r.primitive_value;
}
/// Satisfies the [`MulAssign<@doc.self>`](sus-num-MulAssign.html) concept.
/// Satisfies the [`MulAssign<@doc.self>`]($sus::num::MulAssign) concept.
constexpr inline void operator*=(_self r) & noexcept {
primitive_value *= r.primitive_value;
}
/// Satisfies the [`DivAssign<@doc.self>`](sus-num-DivAssign.html) concept.
/// Satisfies the [`DivAssign<@doc.self>`]($sus::num::DivAssign) concept.
constexpr inline void operator/=(_self r) & noexcept {
primitive_value /= r.primitive_value;
}
/// Satisfies the [`RemAssign<@doc.self>`](sus-num-RemAssign.html) concept.
/// Satisfies the [`RemAssign<@doc.self>`]($sus::num::RemAssign) concept.
///
/// Assigns the remainder from the division of two floats.
///
Expand Down
Loading

0 comments on commit 525e4d5

Please sign in to comment.