boostorg / boostorg/safe_numerics

docs: example differs from its description

Open
#113 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
222
Forks
46
PR merge metrics
No merged PRs in 30d

Description

The example at https://www.boost.org/doc/libs/1_77_0/libs/safe_numerics/doc/html/eliminate_runtime_penalty/3.html is aimed to demonstrate how different type promotion policies and exception policies can be combined. The description says:

> As before, we define a type safe_t to reflect our view of legal values for this program. This uses the automatic type promotion policy as well as the loose_trap_policy exception policy to enforce elimination of runtime penalties.

But `safe_t` is defined as:
```cpp
using safe_t = safe_signed_range<
-24,
82,
native,
loose_exception_policy
>;
```
According to description it should perhaps be defined as:
```cpp
using safe_t = safe_signed_range<
-24,
82,
automatic,
loose_trap_policy
>;
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open the linked Safe Numerics documentation example and compare the prose describing safe_t with its displayed definition. Check the documented promotion and exception policies against the example, then update the example or description so they agree and verify the rendered page shows the intended combination.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.