C++20 removed support for `throw()` exception specifications, so at
least clang-19 is now emitting errors on them. Replaced exception
specifications with BOOST_NOEXCEPT_OR_NOTHROW, which converts `throw()`
to `noexcept`, but keeps the code formally compatible with C++03.
The compiler-generated copy constructor and copy assignment operator are deprecated since C++11 on classes with user-declared destructors.
This change allows clean compilation with the -Wdeprecated-copy-dtor/-Wdeprecated-copy-with-user-provided-dtor flag.
Co-authored-by: Ed Catmur <edward.catmur@mavensecurities.com>
* Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers.
* Restored a Borland check.
* Specify std:: for all standard identifiers and remove 'using namespace std:'.
* Removed std:: from C header abort call.
* Moved 'using namespace std;' after header file inclusions
This fixes numerous compilation warnings:
note: #pragma message:
The practice of declaring the Bind placeholders (_1, _2, ...)
in the global namespace is deprecated.
Please use <boost/bind/bind.hpp> + using namespace boost::placeholders,
or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
An unintrusive implementation - no existing interfaces changed, and a single addition for obtaining all of the different long names.
Notes:
* Tests added for the new functionality, and existing tests expanded to take it into account.
* It is now impossible to specify long names with commas in them (but then, that wasn't properly supported before either, more of an oversight).
* The multiple long options are not included in the usage information - just the first one of them is printed
It presently fails like this:
/usr/bin/ld: unrecognized option '--push-state--no-as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
"g++-7" -o "../../bin.v2/libs/program_options/test/gcc-7/debug/cxxstd-03-iso/link-static/test_convert"
-Wl,--start-group
"../../bin.v2/libs/program_options/test/gcc-7/debug/cxxstd-03-iso/link-static/test_convert.o"
"../../bin.v2/libs/program_options/build/gcc-7/debug/cxxstd-03-iso/link-static/libboost_program_options.a"
-Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -m64 -std=c++03 -g -fno-sanitize-recover=undefined -fsanitize=undefined
This error seems like some misconfiguration of compiler install, not something I can fix.
* Added multiple inputs to example
In the section after the introduction of using value<vector<...>> to store
multiple values, I updated the example to show multiple input values and their
results.
* Make it clear how to enable sections for ini files
It was unclear how the user should support sections, should they have nested options_description's (no), nested variables_map's (no), it is just a dotted string that is input! This adds a snippet showing that.
* Added an example for environment options
This example shows how to use program_options to pull environmental options
into a program. This instance uses a function to map env options to config
options.
* Added an example showing different types in a config file
I went through a lot of the common types that a user may want to include in
a config file (especially the boolean options) and showed an example with
them all.
With some minor modifications, this could also be added to the tests directory
as there are several cases in here that I didn't see checked anywhere else in
the code.
* Added explanation comments to new examples
* Added an example with a heirarchy of inputs
This file shows an example program that can get inputs from the command line,
environmental variables, multiple config files specified on the command line,
and a default config file. There are multiple usage examples at the bottom in
the comments.
* Reference to example showing environment options
* Added section detailing type conversion.
Added explicity acknowledging that hex/oct/bin formatted strings aren't allowed.
Detailed the bool_switch value and what strings evaluate true/false.
* Added a global to the config file example
* Semicolon typo
* Split components into seperate functions
* Added unregistered entry and flag to prevent error
* Added logic to capture unregistered value
* Build new examples
* Backslashes need escaping on unix
* match permissions