algorithm/string -- find_all_regex() gives a compiler error when the result container is vector<iterator_range<string::iterator>>
まだ誰も着手していません。
評価
調査の方向性
まず、std::vector<boost::iterator_rangestd::string::iterator> を使用した、提供されている boost::find_all_regex の呼び出しを再現し、std::vectorstd::string の場合と比較します。リンクされている find_all_regex のドキュメントと関数の実装を読みます。完了の条件は、文書化されているコンテナの不一致を解消するか、ドキュメントを明確に修正し、テストが利用可能な場合は報告された例をカバーすることです。
索引モデルが issue の本文から書いたものです。
説明
The doc says that the container we should pass to this function can be std::vector<boost::iterator_rangestd::string::iterator>. But when I run the program it gives a compile error. But when the result container passed, is a std::vectorstd::string, everything works fine.
First code snippet is using std::vector<boost::iterator_rangestd::string::iterator> as the result.
#include "boost/algorithm/string/split.hpp"
#include "boost/range/iterator_range_core.hpp"
#include <iostream>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <vector>
int main(int, char**) {
std::string s("Hello world");
boost::regex regex("\\w");
std::vector<boost::iterator_range<std::string::iterator>> result;
boost::find_all_regex(result, s, regex);
}
Following is the last 3 lines of the compiler error. The whole error is too long.
c:\mingw\include\c++\9.2.0\bits\stl_iterator.h:787:11: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >' to 'const __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string >&'
c:\mingw\include\c++\9.2.0\bits\stl_iterator.h:787:11: note: candidate: 'constexpr __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string >::__normal_iterator(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string >&&)'
c:\mingw\include\c++\9.2.0\bits\stl_iterator.h:787:11: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string >' to '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string >&&'
Also I ran the same program in Clang compiler too. Still the same result.
But when I run the following program with the container as std::vectorstd::string everything works without a hitch.
#include "boost/algorithm/string/split.hpp"
#include "boost/range/iterator_range_core.hpp"
#include <iostream>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <string>
#include <vector>
int main(int, char**) {
std::string s("Hello world");
boost::regex regex("\\w");
std::vector<std::string> result;
boost::find_all_regex(result, s, regex);
}
- 主要言語
- C++
- スター
- 131
- フォーク
- 117
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/algorithm のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Automated formatting オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
boostorg/algorithm の issue をすべて見る
似ている issue
-
ai_reviewed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ydb-platform/ydb#53869 · コメント 3 件 ·
-
bug cert blocker needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conan-io/conan-center-index#31035 ·
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
vllm-project/vllm-ascend#17329 ·