program_options support std::vector and not boost::container::vector

オープン
#111 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
cli

調査の方向性

報告された po::value<boost::container::vectorstd::string> の例を再現し、既存の std::vector の処理と並行して program_options のパースを追跡します。ベクター値がどのように変換されるか、またパースで istream 演算子が不必要に要求されていないかを確認します; 示されたオプション形式がその演算子なしで正常にパースされ、テストカバレッジがあることをもって完了とします。

索引モデルが issue の本文から書いたものです。

説明

enhancement

It may seem rather obvious, but boost::program_options doesn't appear to support boost::container::vector in the manner it supports std::vector. An an example, creating an option:

("test,T", po::value<boost::container::vector<std::string> >(),"Run a named test suite. -T <suite>:<suite arguments>")
will cause clang to say:


In file included from rogue.c++:6:
In file included from /usr/local/include/boost/program_options.hpp:15:
In file included from /usr/local/include/boost/program_options/options_description.hpp:13:
In file included from /usr/local/include/boost/program_options/value_semantic.hpp:14:
In file included from /usr/local/include/boost/lexical_cast.hpp:32:
In file included from /usr/local/include/boost/lexical_cast/try_lexical_convert.hpp:44:
/usr/local/include/boost/lexical_cast/detail/converter_lexical.hpp:243:13: error: static_assert
      failed due to requirement 'has_right_shift<std::istream, boost::container::vector<std::string, void, void>,
      boost::binary_op_detail::dont_care>::value || boost::has_right_shift<std::wistream,
      boost::container::vector<std::string, void, void>, boost::binary_op_detail::dont_care>::value' "Target type is
      neither std::istream`able nor std::wistream`able"
  ...BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_right_shift<std::basic_istream<wchar_t>, T >::value),
     ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

... among other "nice" things. I've tried creating an istream for boost::container::vector and prototyping it before including program_options, but either I am not worthy or it's not possible for me to easily retrofit.

... seems like either program_options needs to make the istream optional (I'm certainly not using it) or convince boost::container::vector to include it. Dunno.

主要言語
C++
スター
136
フォーク
117
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/program_options のほかの issue

boostorg/program_options の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。