Opened 9 years ago

Closed 8 years ago

#2425 closed Bugs (fixed)

woption_from_option missing some fields

Reported by:… Owned by: Vladimir Prus
Milestone: Boost 1.37.0 Component: program_options
Version: Boost 1.36.0 Severity: Problem
Keywords: Cc:


As you known, woption_from_option funtion (parsers.cpp) could convert the char option to a wchar_t option. But it seems missing some fields when construct new object, such as original_tokens and unregistered.

To fix, we could add two lines for missed fields

woption woption_from_option(const option& opt) {

woption result; result.string_key = opt.string_key; result.position_key = opt.position_key;

std::transform(opt.value.begin(), opt.value.end(),

back_inserter(result.value), bind(from_utf8, _1));

Missing two fields std::transform(opt.original_tokens.begin(), opt.original_tokens.end(),

back_inserter(result.original_tokens), bind(from_utf8, _1));

result.unregistered = opt.unregistered; return result;


Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by Vladimir Prus

Resolution: fixed
Status: newclosed

(In [53441]) Properly convert original_tokens and unregistered to woption.

Fixes #2425.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Vladimir Prus.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.