program_options support std::vector and not boost::container::vector
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the reported po::value<boost::container::vectorstd::string> example and trace program_options parsing alongside its existing std::vector handling. Check how vector values are converted and whether parsing unnecessarily requires an istream operator; done means the shown option form parses successfully without that operator and has test coverage.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C++
- Stars
- 136
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/program_options
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#147 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
boostorg/program_options#146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
boostorg/program_options#144 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#142 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
boostorg/program_options#139 ·
All issues in boostorg/program_options
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·