boostorg / boostorg/hana

Invalid requirements for insert in the documentation

Open Beginner friendly
#466 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

[Documentation states](http://boostorg.github.io/hana/group__group-Sequence.html#gae22a1a184b1b2dd550fa4fa619bed2e9):

>it must also be true that `n < length(xs)`

So if I have a sequence of size 2, the only valid indexes are 0 and 1 then I wouldn't be able to insert a new element at all valid places. Insert means insert before, so it should be valid to insert before the end iterator (i.e. `length(xs)`) and the actual requirement should be:

>it must also be true that `n <= length(xs)`

I haven't fully tested, but the compiler accepts `n=length(xs)`, so for now I'm assuming that only the documentation is outdated.

Thank you for the excellent library.

Contributor guide

Open the contributing guide

Research direction

Start with the linked Boost.Hana Sequence documentation and locate the requirements for insert. Confirm that insertion before the end position is supported, then update the stated bound from n < length(xs) to n <= length(xs); done means the documentation matches the accepted behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.