irange makes non-emtpy ranges when first is greater than last
まだ誰も着手していません。
評価
調査の方向性
irange.hpp の 210 行目と 219 行目付近にあるアサーションから始め、既存の test_irange ケースを確認します。報告された呼び出しが反復せずに空の範囲を生成することを検証し、これらのケースが反復回数 0 で完了するようにテストを追加または更新します。
索引モデルが issue の本文から書いたものです。
説明
the simple example irange(-5) I would expect to be an empty range, i.e.
int32_t end = -5;
int64_t count = 0;
for (int32_t i = 0; i < end; ++i)
// this line will never be reached
++count;
std::cout << count << std::endl; // 0
count = 0;
for (auto i : boost::irange(end))
// this should never be reached, but it will
// iterate past int32_t max until it reaches -5
++count;
std::cout << count << std::endl; // 4294967291
My expectations is the following tests should pass with no iterations, but many fail on asserts in the test but will be large ranges in release
test_irange(-5);
test_irange(0, -5); // this fails on assert at irange.hpp#L210
test_irange(5, 10, -1); // this fails on assert at irange.hpp#L219
test_irange(10, 5, 1); // this fails on assert at irange.hpp#L219
- 主要言語
- C++
- スター
- 45
- フォーク
- 104
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/range のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ros2/message_filters#338 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
subsurface/subsurface#4984 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google-ai-edge/LiteRT-LM#3739 ·