From cb14b1db380aa05afe705ff35b84577d1e3f9343 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Fri, 19 Jun 2026 10:40:55 -0600 Subject: [PATCH] :books: Small documentation fixes. Problem: - Documentation has typos, small errors and a few places that could be better. Solution: - Fix them. --- .github/workflows/asciidoctor-ghpages.yml | 2 +- docs/concepts.adoc | 5 ++++- docs/ct_format.adoc | 3 ++- docs/function_traits.adoc | 2 +- docs/functional.adoc | 1 - docs/optional.adoc | 4 ++-- docs/type_traits.adoc | 3 +++ 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/asciidoctor-ghpages.yml b/.github/workflows/asciidoctor-ghpages.yml index ae6341e5..51ab0e54 100644 --- a/.github/workflows/asciidoctor-ghpages.yml +++ b/.github/workflows/asciidoctor-ghpages.yml @@ -33,7 +33,7 @@ jobs: runs-on: *runner steps: - name: Checkout source - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 diff --git a/docs/concepts.adoc b/docs/concepts.adoc index a6dfacc5..4c12553b 100644 --- a/docs/concepts.adoc +++ b/docs/concepts.adoc @@ -58,6 +58,9 @@ static_assert(not stdx::complete); static_assert(stdx::complete); ---- +CAUTION: Using class completeness to make decisions about definitions is a good +way to get an ODR violation. + === `has_trait` `has_trait` is used to turn a type trait (standard or otherwise) into a concept. @@ -78,7 +81,7 @@ parameter that has a `constexpr static bool value` member. === `same_as_unqualified` -`same_as_unqualified` is true when two types are the same are removing top-level +`same_as_unqualified` is true when two types are the same after removing top-level cv-qualifications and references, if any. It's useful for constraining hidden friends -- particularly when member functions would need to be replicated with different reference qualifiers before C++23. diff --git a/docs/ct_format.adoc b/docs/ct_format.adoc index 8b92c510..633b7b0a 100644 --- a/docs/ct_format.adoc +++ b/docs/ct_format.adoc @@ -61,7 +61,8 @@ auto s = stdx::ct_format<"Hello {} {}">(CX_VALUE(int), CX_VALUE(E::value)); ---- NOTE: Compile-time formatting is done with https://github.com/fmtlib/fmt[fmtlib] -and supports the same formatting DSL. Positional arguments are not supported. +and supports the same formatting DSL. Named arguments are supported, but only as +a way to "tag", not for position-independence. When formatting a compile-time `stdx::format_result`, the strings and argument tuples are collapsed to a single `stdx::format_result`: diff --git a/docs/function_traits.adoc b/docs/function_traits.adoc index 0a1b97ad..be7b109e 100644 --- a/docs/function_traits.adoc +++ b/docs/function_traits.adoc @@ -21,7 +21,7 @@ using l_return = stdx::return_t; // int using l_args = stdx::args_t; // std::tuple ---- -`stdx::args_t` returns a list of the function arguments. `std::decayed_args_t` +`stdx::args_t` returns a list of the function arguments. `stdx::decayed_args_t` returns the same list, but with `std::decay_t` applied to each element. This is useful for example when you need to copy and store a tuple of the arguments. [source,cpp] diff --git a/docs/functional.adoc b/docs/functional.adoc index c628082a..8c7ba196 100644 --- a/docs/functional.adoc +++ b/docs/functional.adoc @@ -51,7 +51,6 @@ except it calls (unary) `operator+` instead of `operator-`. It also has a specialization for `void` which is _transparent_ like that of https://en.cppreference.com/w/cpp/utility/functional/negate_void.html[`std::negate`]. ->>>>>>> 7a78082 (:sparkles: Add `dereference`) === `with_result_of` diff --git a/docs/optional.adoc b/docs/optional.adoc index 5f9670df..378809b5 100644 --- a/docs/optional.adoc +++ b/docs/optional.adoc @@ -52,7 +52,7 @@ static_assert(sizeof(stdx::optional == 1); To use `stdx::optional`, specialize `stdx::tombstone_traits` for the required type, giving it a call operator that returns the sentinel value. After that, -`stdx::optional`'s interface mirrors that of +`stdx::optional`​'s interface mirrors that of https://en.cppreference.com/w/cpp/utility/optional[`std::optional`]. The C\+​+23 monadic operations on `std::optional` are available on `stdx::optional` with C++17. @@ -63,7 +63,7 @@ even non-movable) types. NOTE: Like `std::optional`, `stdx::optional` can be constructed with https://en.cppreference.com/w/cpp/utility/optional/nullopt_t[`std::nullopt`] or with https://en.cppreference.com/w/cpp/utility/in_place[`std::in_place`]. -(`stdx` does not redefine these types.) +(`stdx` does not define its own versions of these.) NOTE: `stdx::optional` does not use exceptions. There is no `stdx::bad_optional_access`. If you access a disengaged `stdx::optional`, you diff --git a/docs/type_traits.adoc b/docs/type_traits.adoc index 1543ee52..1da95baa 100644 --- a/docs/type_traits.adoc +++ b/docs/type_traits.adoc @@ -81,6 +81,9 @@ static_assert(not stdx::is_complete_v); static_assert(stdx::is_complete_v); ---- +CAUTION: Using class completeness to make decisions about definitions is a good +way to get an ODR violation. + === `is_function_object_v` `is_function_object_v` is a variable template that detects whether a type is a