Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions doc/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
** xref:examples.adoc#examples_fmt_format[Formatting]
** xref:examples.adoc#examples_iostream[Stream I/O]
** xref:examples.adoc#examples_bit[Bit Manipulation]
** xref:examples.adoc#examples_verified_construction[Verified Types: Construction]
** xref:examples.adoc#examples_verified_arithmetic[Verified Types: Arithmetic]
** xref:examples.adoc#examples_verified_runtime[Verified Types: Runtime Capabilities]
** xref:examples.adoc#examples_verified_compile_fail[Verified Types: Compile-Time Overflow]
* xref:pretty_printers.adoc[]
* xref:api_reference.adoc[]
** xref:api_reference.adoc#api_namespaces[Namespaces]
Expand All @@ -27,7 +23,6 @@
* xref:policies.adoc[]
* xref:unsigned_integers.adoc[]
* xref:bounded_uint.adoc[]
* xref:verified_integers.adoc[]
* xref:literals.adoc[]
* xref:limits.adoc[]
* xref:format.adoc[]
Expand Down
28 changes: 0 additions & 28 deletions doc/modules/ROOT/pages/api_reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,6 @@ https://www.boost.org/LICENSE_1_0.txt
| Safe unsigned integer constrained to a compile-time range `[Min, Max]`
|===

=== Verified Integer Types

[cols="1,2", options="header"]
|===
| Type | Description

| xref:verified_integers.adoc[`verified_u8`]
| Compile-time verified safe unsigned 8-bit integer

| xref:verified_integers.adoc[`verified_u16`]
| Compile-time verified safe unsigned 16-bit integer

| xref:verified_integers.adoc[`verified_u32`]
| Compile-time verified safe unsigned 32-bit integer

| xref:verified_integers.adoc[`verified_u64`]
| Compile-time verified safe unsigned 64-bit integer

| xref:verified_integers.adoc[`verified_u128`]
| Compile-time verified safe unsigned 128-bit integer

| xref:verified_integers.adoc[`verified_bounded_integer<Min, Max>`]
| Compile-time verified bounded unsigned integer constrained to `[Min, Max]`
|===

=== Enumerations

[cols="1,2", options="header"]
Expand Down Expand Up @@ -346,7 +321,4 @@ This header is not included in the convenience header since it requires external

| `<boost/safe_numbers/byte_conversions.hpp>`
| Byte order conversion functions (`to_be`, `from_be`, `to_le`, `from_le`, `to_be_bytes`, `from_be_bytes`, `to_le_bytes`, `from_le_bytes`, `to_ne_bytes`, `from_ne_bytes`)

| `<boost/safe_numbers/verified_integers.hpp>`
| Verified integer types (`verified_u8`, `verified_u16`, `verified_u32`, `verified_u64`, `verified_u128`, `verified_bounded_integer<Min, Max>`)
|===
25 changes: 0 additions & 25 deletions doc/modules/ROOT/pages/bit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -183,31 +183,6 @@ Implemented using a lookup-table approach that reverses each byte individually a

NOTE: `bitswap` is not available for `bounded_uint` types. Bit reversal can produce values outside the valid bounded range, making the operation semantically meaningless for bounded integers.

== Verified Types

The bit functions have special behavior with xref:verified_integers.adoc[verified types]:

Functions that return `int` or `bool` (`has_single_bit`, `bit_width`, `countl_zero`, `countl_one`, `countr_zero`, `countr_one`, `popcount`) work at runtime with verified types.
These functions only read the value via the `constexpr` conversion operator.

Functions that return the safe type (`bit_ceil`, `bit_floor`, `rotl`, `rotr`, `byteswap`, `bitswap`) have `consteval` overloads for verified types, meaning they can only be called at compile time.
The `consteval` overloads use a `requires` clause to distinguish them:

[source,c++]
----
// Runtime overload (non-verified types)
template <unsigned_library_type UnsignedInt>
requires (!is_verified_type_v<UnsignedInt>)
constexpr auto bit_ceil(UnsignedInt x) noexcept -> UnsignedInt;

// Compile-time overload (verified types only)
template <unsigned_library_type UnsignedInt>
requires is_verified_type_v<UnsignedInt>
consteval auto bit_ceil(UnsignedInt x) noexcept -> UnsignedInt;
----

The same pattern applies to `bit_floor`, `rotl`, `rotr`, `byteswap`, and `bitswap`.

== Examples

.This https://github.com/boostorg/safe_numbers/blob/develop/examples/bit.cpp[example] demonstrates the bit manipulation functions.
Expand Down
Loading