Idiomatic way to cast or convert between different r_vector types
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
Start with the conversion section of the vignette at the linked “fewer implicit conversions” heading, then inspect the cpp11::as_cpp examples and the Rf_coerceVector usage described in the issue. Document the idiomatic conversion between r_vector types and clarify whether the converted vector needs protection; done means the vignette answers both questions with a supported example.
索引モデルが issue の本文から書いたものです。
説明
The following conversions results in a run time error Invalid input type, expected 'integer' actual 'logical'
// cpp11::logicals val
cpp11::integers ints(val);
cpp11::integers ints = cpp11::as_cpp<cpp11::integers>(val);
It's not clear to me why logicals cannot be re-interpreted as integers. After all it's the same internal representation.
What is an idiomatic way to convert within cpp11 when converting at R level is not an option? Is it enough to cpp11::integers X2(Rf_coerceVector(X, INTSXP));, or do I still need to protect the converted vector?
It would be great if this information could be added to the conversion section of the vignette.
Thanks!
`
- 主要言語
- C++
- スター
- 224
- フォーク
- 52
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
r-lib/cpp11 のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100