Skip to content

Commit

Permalink
Try explicit end of anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
rollbear committed Jan 27, 2025
1 parent db5c170 commit e6616dd
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Boost Software License 1.0
* [Other libraries](#other)
* [Presentations](#presentations)

# <A name="intro"/>Intro
# <A name="intro"></A>Intro

Very much inspired by [@foonathan's](https://twitter.com/foonathan)
[`type_safe`](https://github.com/foonathan/type_safe) library, but aim is
Expand Down Expand Up @@ -71,7 +71,7 @@ the underlying type can be, for compilers and standards that support it.
*strong_type* uses the std library module, with `import std;` if you
define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
# <A name="modifiers"/> Modifiers:
# <A name="modifiers"></A>Modifiers:
* <A name="affine_point"></A>`strong::affine_point<D>` allows instances to be
subtracted (yielding a `D`) or to add or subtract a `D` to an instance.
Expand Down Expand Up @@ -251,31 +251,31 @@ define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
Available in `strong_type/ordered.hpp`
* <A name="ordered_with"/>`strong::ordered_with<Ts...>` provides operators `<`,
* <A name="ordered_with"></A>`strong::ordered_with<Ts...>` provides operators `<`,
`<=`, `>=` and `>` between the strong type and each of the types `Ts...`.
Note! While `Ts` can include other strong types, it cannot refer to the strong
type being defined. Use [`strong::ordered`](#ordered) for that.
Available in `strong_type/ordered_with.hpp`
* <A name="ostreamable"/>`strong::ostreamable`. Provides the default
* <A name="ostreamable"></A>`strong::ostreamable`. Provides the default
[`ostream`](https://en.cppreference.com/w/cpp/io/basic_ostream) insertion
`operator<<` for the strong type, as handled by the underlying type. Provide
your own operator instead if you prefer a custom ostream insertion operator.
Available in `strong_type/ostreamable.hpp`
* <A name="partially_ordered"/>`strong::partially_ordered` provides operator
* <A name="partially_ordered"></A>`strong::partially_ordered` provides operator
`<=>` The strong type offers the same ordering relation as the underlying type.
The result is [`std::partial_ordering`](https://en.cppreference.com/w/cpp/utility/compare/partial_ordering).
Note! This does not imply [´strong::equality´](#equality).
Available in `strong_type/ordered.hpp`
* <A name="partially_ordered_with"/>`strong::partially_ordered_with<Ts...>`
* <A name="partially_ordered_with"></A>`strong::partially_ordered_with<Ts...>`
provides operator `<=>` between the strong type and each of the types `Ts...`.
Note! While `Ts` can include other strong types, it cannot refer to the strong
type being defined. Use [`strong::partially_ordered`](#partially_ordered) for
Expand All @@ -285,13 +285,13 @@ define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
Available in `strong_type/ordered_with.hpp`
* <A name="pointer"/>`strong::pointer` allows `operator*` and `operator->`, and
* <A name="pointer"></A>`strong::pointer` allows `operator*` and `operator->`, and
comparisons with `nullptr` providing the underlying type supports it.
Available in `strong_type/pointer.hpp`
* <A name="range"/>`strong::range` adds the functionality needed to iterate over
* <A name="range"></A>`strong::range` adds the functionality needed to iterate over
the elements. The [iterator types](#iterator) are using the same tag as using
in the range. Only implements types `iterator` and `const_iterator`, and thus
`.begin()`, `.end()`, `.cbegin()`, `.cend()`, `.begin() const` and
Expand All @@ -301,37 +301,37 @@ define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
Available in `strong_type/range.hpp`
* <A name="regular"/>`strong::regular`. Same as [`strong::semiregular`](#semiregular)
* <A name="regular"></A>`strong::regular`. Same as [`strong::semiregular`](#semiregular)
and [`strong::equality`](#equality). A good default base for most types.
Available in `strong_type/regular.hpp`
* <A name="scalable_with"/>`strong::scalable_with<Ts...>` Allows multiplying and
* <A name="scalable_with"></A>`strong::scalable_with<Ts...>` Allows multiplying and
dividing the value with each type `Ts`, providing the underlying type supports
it. It also allows dividing instances of `scalable_with<>`, if the underlying
type supports it, and returns the first type in the list of `Ts...`.
Available in `strong_type/scalable_with.hpp`
* <A name="semiregular"/>`strong::semiregular`. This gives you
* <A name="semiregular"></A>`strong::semiregular`. This gives you
[`strong::default_constructible`](#default_constructible)
move/copy constructible, move/copy assignable and swappable.
A decent default for many types.
Available in `strong_type/semiregular.hpp`.
* <A name="strongly_ordered"/>`strong::strongly_ordered` provides operator `<=>`
* <A name="strongly_ordered"></A>`strong::strongly_ordered` provides operator `<=>`
The strong type offers the same ordering relatin as the underlying type. The
result is [`std::strong_ordering`](https://en.cppreference.com/w/cpp/utility/compare/strong_ordering).
Note! This does not imply [´strong::equality<Ts...>´](#equality).
Available in `strong_type/ordered.hpp`
* <A name="strongly_ordered_with"/>`strong::strongly_ordered_with<Ts...>`
* <A name="strongly_ordered_with"></A>`strong::strongly_ordered_with<Ts...>`
provides operator `<=>` between the strong type and each of the types `Ts...`.
Note! While `Ts` can include other strong types, it cannot refer to the strong
type being defined. Use [`strong::strongly_ordered`](#strongly_ordered) for
Expand All @@ -341,20 +341,20 @@ define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
Available in `strong_type/ordered_with.hpp`
* <A name="unique"/>`strong::unique`. Make the type move constructible and move
* <A name="unique"></A>`strong::unique`. Make the type move constructible and move
assignable but not copy constructible nor copy assignable.
Available in `strong_type/unique.hpp`
* <A name="weakly_ordered"/>`strong::weakly_ordered` provides operator `<=>`
* <A name="weakly_ordered"></A>`strong::weakly_ordered` provides operator `<=>`
The strong type offers the same ordering relatin as the underlying type. The
result is [`std::weak_ordering`](https://en.cppreference.com/w/cpp/utility/compare/weak_ordering).
Note! This does not imply [´strong::equality´](#equality).
Available in `strong_type/ordered.hpp`
* <A name="weakly_ordered_with"/>`strong::weakly_ordered_with<Ts...>` provides
* <A name="weakly_ordered_with"></A>`strong::weakly_ordered_with<Ts...>` provides
operator `<=>` between the strong type and each of the types `Ts...`.
Note! While `Ts` can include other strong types, it cannot refer to the strong
type being defined. Use [`strong::weakly_ordered`](#weakly_ordered) for
Expand All @@ -365,7 +365,7 @@ define the macro `STRONG_TYPE_IMPORT_STD_LIBRARY=1`.
# <A name="utilities"/> Utilities:
# <A name="utilities"></A>Utilities:
A number of small utilities are available directly in `strong_type/type.hpp`.
Expand Down Expand Up @@ -415,7 +415,7 @@ A number of small utilities are available directly in `strong_type/type.hpp`.
All `static_assert`s above pass.
# <A name="writing_modifier"/>Writing a modifier
# <A name="writing_modifier"></A>Writing a modifier
A modifier is a nested structure. The outer type, a struct or class, is what
the user sees. Inside it is a struct/class template that is a
Expand Down Expand Up @@ -677,7 +677,7 @@ struct optional
};
```

# <A name="selftest"/> Self test
# <A name="selftest"></A>Self test

To build the self-test program(s):

Expand All @@ -697,15 +697,15 @@ The build will produce the test programs `self_test`, and conditionally also
N.B. Microsoft Visual Studio MSVC compiler < 19.22 does not handle `constexpr`
correctly. Those found to cause trouble are disabled for those versions.

## <A name="other"/> Other libraries:
## <A name="other"></A>Other libraries:

| Library | Author |
|-----------------------------------------------------|-------------------|
| [type_safe](https://github.com/foonathan/type_safe) | Jonathan Müller |
| [NamedType](https://github.com/joboccara/NamedType) | Jonathan Boccara |
| [strong_typedef](https://github.com/anthonywilliams/strong_typedef) | Anthony Williams (justsoftwaresolutions) |

## <A name="presentations"/> Presentations about defining and using strong types
## <A name="presentations"></A>Presentations about defining and using strong types

| | |
|---|---|
Expand Down

0 comments on commit e6616dd

Please sign in to comment.