boostorg / boostorg/program_options

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

Offen
#111 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
C++
Sterne
136
Forks
117
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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 >(),"Run a named test suite. -T :")
`
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,
boost::binary_op_detail::dont_care>::value || boost::has_right_shift, 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, 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduziere das gemeldete po::value>-Beispiel und verfolge das program_options-Parsing parallel zu seiner bestehenden std::vector-Behandlung. Prüfe, wie Vektorwerte konvertiert werden und ob das Parsing unnötigerweise einen istream-Operator erfordert; als erledigt gilt die Aufgabe, wenn die gezeigte Optionsform ohne diesen Operator erfolgreich geparst wird und dafür Testabdeckung vorhanden ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.