* Prevent malformed numbers from being parsed as correct numbers.
Fixes#78. If you passed a string for example "test" it would get parsed to 1400.
The problem was that the parser did not throw an exception when an incorrect char was encountered.
Also a number without 0x in front with hexadecimal digits in it got parsed.
The number was treated as a hexadecimal number but it was still calculated with base 10.
So now before the current char is used, it is checked if it is valid in the current base.
Furthermore the number 0x0 was not a valid number, it now is a special case in the `integer_pattern`.
* Fixed `integer_pattern` so it works correctly under clang. Added testcase for invalid integers and for 0x0 being a valid number.
´Value´ and ´standard_value´ don't have a virtual destructor. When I understand the code right, this is intended, because they are used through ´shared_ptr´ and so its not required. Nevertheless, clang does warn about it, since at the point of the destructor call it can not check if the object has a final type. Adding the C++11 keyword ´final´ to ´standard_value´ avoids this warning.
Fixes#62. This fixes compiler warnings that are raised by MSVC.
In one case the code that was warned about was never executed, but
this compiles it out in that case to silence the warning.
Fixes#39. Closes#40. This is an overhaul of the way that integer
arguments are parsed. Instead of using std::istream, which allows,
for example, negative integers for unsigned types, we use our own
parser.
This allows us to do proper range checking depending on the type,
and to correctly check for negative values passed to unsigned types.
This also allows the handling of base 16 numbers.
Fixes#50. This enables -Wall -Wextra -Wshadow and sets -Werror so that
the build fails if there are any warnings. All warnings that came up are
also fixed
Fixes#36. This fixes handling arguments passed after `--` when no
positional arguments have been declared, or when the positional
arguments have all been used up. The bug was that the extra arguments
were lost. Now they are retained in the modified argv.
Fixes#33.
This PR uses cmake's interface library feature:
An INTERFACE library target does not directly create build output,
though it may have properties set on it and it may be installed,
exported and imported.
This makes it easier to include the header only library in a cmake
project. After using add_subdirectory on the cxxopts directory, one
simply needs to include cxxopts in their target_link_libraries, which
will allow the user's target to inherit the properties of the cxxopts
header library (see changes to example and test).