Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nyanten::Standard_::calculateReplacementNumber(first, last, n)last が未使用である #7

Open
Apricot-S opened this issue Sep 20, 2024 · 0 comments

Comments

@Apricot-S
Copy link

概要

Nyanten::Standard_::calculateReplacementNumber(first, last, n)last が未使用です

以下のように削除してもよいかと思われますが、変更されますか?
ライブラリの利用側からのインターフェースは変わりません。

// nyanten/standard/replacement_number.hpp

template<typename ForwardIterator>
std::uint_fast8_t calculateReplacementNumber(
  ForwardIterator first, std::uint_fast8_t const n)
{
// nyanten/replacement_number.hpp

  std::uint_fast8_t const r0 = Nyanten::Standard_::calculateReplacementNumber(first, n);

発見の経緯

私のシャンテン数計算ライブラリ (https://github.com/Apricot-S/xiangting) で計算結果の検証に Nyanten を使用しようとしています。
cxx crate で Rust バインディングしようとしたところ、以下の警告が出ました。

vscode ➜ /workspaces/xiangting (main) $ cargo build --features correctness
   Compiling xiangting v0.1.0 (/workspaces/xiangting)
warning: [email protected]: In file included from /workspaces/nyanten/nyanten/replacement_number.hpp:10,
warning: [email protected]:                  from /workspaces/xiangting/target/debug/build/xiangting-557201ae84092b90/out/cxxbridge/sources/xiangting/tests/nyanten.rs.cc:1:
warning: [email protected]: /workspaces/nyanten/nyanten/standard/replacement_number.hpp: In instantiation of ‘uint_fast8_t Nyanten::Standard_::calculateReplacementNumber(ForwardIterator, ForwardIterator, uint_fast8_t) [with ForwardIterator = const unsigned char*; uint_fast8_t = unsigned char]’:
warning: [email protected]: /workspaces/nyanten/nyanten/replacement_number.hpp:46:78:   required from ‘uint_fast8_t Nyanten::calculateReplacementNumber(ForwardIterator, ForwardIterator) [with ForwardIterator = const unsigned char*; uint_fast8_t = unsigned char]’
warning: [email protected]: /workspaces/xiangting/target/debug/build/xiangting-557201ae84092b90/out/cxxbridge/sources/xiangting/tests/nyanten.rs.cc:7:110:   required from here
warning: [email protected]: /workspaces/nyanten/nyanten/standard/replacement_number.hpp:66:42: warning: unused parameter ‘last’ [-Wunused-parameter]
warning: [email protected]:    66 |   ForwardIterator first, ForwardIterator last, std::uint_fast8_t const n)
warning: [email protected]:       |                          ~~~~~~~~~~~~~~~~^~~~
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 53.82s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant