Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9695da9

Browse files
authored
fix and optimize documentation (#1131)
- Add anchor for `finally` in `headers.md` so that the link in `README.md` can work - In `README.md` add code formatting for the character types of the `zstring` and `string_span` types - In `README.md` change code formatting to links for GSL types - Vertical alignment
1 parent 4300304 commit 9695da9

2 files changed

Lines changed: 23 additions & 24 deletions

File tree

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ Feature | Suppo
2626
-------------------------------------------------------------------------|:----------:|-------------
2727
[**1. Views**][cg-views] | |
2828
[owner](docs/headers.md#user-content-H-pointers-owner) | ☑ | An alias for a raw pointer
29-
[not_null](docs/headers.md#user-content-H-pointers-not_null) | ☑ | Restricts a pointer / smart pointer to hold non-null values
29+
[not_null](docs/headers.md#user-content-H-pointers-not_null) | ☑ | Restricts a pointer/smart pointer to hold non-null values
3030
[span](docs/headers.md#user-content-H-span-span) | ☑ | A view over a contiguous sequence of memory. Based on the standardized version of `std::span`, however `gsl::span` enforces bounds checking.
3131
span_p | ☐ | Spans a range starting from a pointer to the first place for which the predicate is true
32-
[basic_zstring](docs/headers.md#user-content-H-zstring) | ☑ | A pointer to a C-string (zero-terminated array) with a templated char type
33-
[zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of char
34-
[czstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of const char
35-
[wzstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of wchar_t
36-
[cwzstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of const wchar_t
37-
[u16zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of char16_t
38-
[cu16zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of const char16_t
39-
[u32zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of char32_t
40-
[cu32zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of const char32_t
32+
[basic_zstring](docs/headers.md#user-content-H-zstring) | ☑ | A pointer to a C-string (zero-terminated array) with a templated char type
33+
[zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `char`
34+
[czstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `const char`
35+
[wzstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `wchar_t`
36+
[cwzstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `const wchar_t`
37+
[u16zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `char16_t`
38+
[cu16zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `const char16_t`
39+
[u32zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `char32_t`
40+
[cu32zstring](docs/headers.md#user-content-H-zstring) | ☑ | An alias to `basic_zstring` with dynamic extent and a char type of `const char32_t`
4141
[**2. Owners**][cg-owners] | |
4242
[unique_ptr](docs/headers.md#user-content-H-pointers-unique_ptr) | ☑ | An alias to `std::unique_ptr`
4343
[shared_ptr](docs/headers.md#user-content-H-pointers-shared_ptr) | ☑ | An alias to `std::shared_ptr`
@@ -50,31 +50,31 @@ dyn_array | &#x26
5050
move_owner | ☐ | A helper function that moves one `owner` to the other
5151
[byte](docs/headers.md#user-content-H-byte-byte) | ☑ | Either an alias to `std::byte` or a byte type
5252
[final_action](docs/headers.md#user-content-H-util-final_action) | ☑ | A RAII style class that invokes a functor on its destruction
53-
[finally](docs/headers.md#user-content-H-util-finally) | ☑ | A helper function instantiating `final_action`
53+
[finally](docs/headers.md#user-content-H-util-finally) | ☑ | A helper function instantiating [final_action](docs/headers.md#user-content-H-util-final_action)
5454
[GSL_SUPPRESS](docs/headers.md#user-content-H-assert-gsl_suppress) | ☑ | A macro that takes an argument and turns it into `[[gsl::suppress(x)]]` or `[[gsl::suppress("x")]]`
5555
[[implicit]] | ☐ | A "marker" to put on single-argument constructors to explicitly make them non-explicit
5656
[index](docs/headers.md#user-content-H-util-index) | ☑ | A type to use for all container and array indexing (currently an alias for `std::ptrdiff_t`)
5757
joining_thread | ☐ | A RAII style version of `std::thread` that joins
58-
[narrow](docs/headers.md#user-content-H-narrow-narrow) | ☑ | A checked version of `narrow_cast`; it can throw `narrowing_error`
58+
[narrow](docs/headers.md#user-content-H-narrow-narrow) | ☑ | A checked version of `narrow_cast`; it can throw [narrowing_error](docs/headers.md#user-content-H-narrow-narrowing_error)
5959
[narrow_cast](docs/headers.md#user-content-H-util-narrow_cast) | ☑ | A narrowing cast for values and a synonym for `static_cast`
60-
[narrowing_error](docs/headers.md#user-content-H-narrow-narrowing_error) | ☑ | A custom exception type thrown by `narrow()`
60+
[narrowing_error](docs/headers.md#user-content-H-narrow-narrowing_error) | ☑ | A custom exception type thrown by [narrow](docs/headers.md#user-content-H-narrow-narrow)
6161
[**5. Concepts**][cg-concepts] | ☐ |
6262

6363
## The following features do not exist in or have been removed from the C++ Core Guidelines:
6464
Feature | Supported? | Description
6565
-----------------------------------|:----------:|-------------
66-
[strict_not_null](docs/headers.md#user-content-H-pointers-strict_not_null) | ☑ | A stricter version of `not_null` with explicit constructors
66+
[strict_not_null](docs/headers.md#user-content-H-pointers-strict_not_null) | ☑ | A stricter version of [not_null](docs/headers.md#user-content-H-pointers-not_null) with explicit constructors
6767
multi_span | ☐ | Deprecated. Multi-dimensional span.
6868
strided_span | ☐ | Deprecated. Support for this type has been discontinued.
6969
basic_string_span | ☐ | Deprecated. Like `span` but for strings with a templated char type
70-
string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of char
71-
cstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of const char
72-
wstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of wchar_t
73-
cwstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of const wchar_t
74-
u16string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of char16_t
75-
cu16string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of const char16_t
76-
u32string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of char32_t
77-
cu32string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of const char32_t
70+
string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `char`
71+
cstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `const char`
72+
wstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `wchar_t`
73+
cwstring_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `const wchar_t`
74+
u16string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `char16_t`
75+
cu16string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `const char16_t`
76+
u32string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `char32_t`
77+
cu32string_span | ☐ | Deprecated. An alias to `basic_string_span` with a char type of `const char32_t`
7878

7979
This is based on [CppCoreGuidelines semi-specification](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gsl-guidelines-support-library).
8080

docs/headers.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,7 @@ void operator=(final_action&&) = delete;
806806
807807
Move construction is allowed. Copy construction is deleted. Copy and move assignment are also explicitely deleted.
808808
809-
#### Non-member functions
810-
809+
#### <a name="H-util-finally" />Non-member functions
811810
```cpp
812811
template <class F>
813812
auto finally(F&& f) noexcept;

0 commit comments

Comments
 (0)