Ticket #12535: program_options_uint8_demo.cc

File program_options_uint8_demo.cc, 375 bytes (added by Kalle Olavi Niemitalo <kon@…>, 5 years ago)

reproduce the error (Boost 1.55.0, GCC 4.9.2, Debian 8.8)

Line 
1#include <cassert>
2#include <boost/program_options.hpp>
3
4int
5main()
6{
7 using namespace boost::program_options;
8 options_description desc("Options");
9 std::uint8_t num = 0;
10 desc.add_options()
11 ("num", value(&num))
12 ;
13
14 variables_map vm;
15 const char *const args[] = { "prog", "--num=241" };
16 store(parse_command_line(2, args, desc), vm);
17 notify(vm);
18 assert(num == 241);
19}