[Boost-bugs] [Boost C++ Libraries] #2425: woption_from_option missing some fields

Subject: [Boost-bugs] [Boost C++ Libraries] #2425: woption_from_option missing some fields
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-20 04:20:34


#2425: woption_from_option missing some fields
--------------------------------+-------------------------------------------
 Reporter: flier.lu_at_[hidden] | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: program_options
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 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;
         }

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2425>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC