Boost logo

Boost Users :

From: Sergei Politov (spolitov_at_[hidden])
Date: 2008-02-19 05:39:14


The following example could not be compiled:
=================================================================
#include <string>
#include <boost/program_options.hpp>

namespace po = boost::program_options;

int main()
{
  std::wstring test;
  po::options_description desc("Allowed options");
  desc.add_options()
    ("test", po::wvalue<std::wstring>(&test)->default_value(L"value"),
"description");
}
=================================================================
It is due to wvalue::default_value tries to do
lexical_cast<std::string>(std::wstring).
Also I cannot change default_value to default_value("value") as soon as it
accepts only something convertible to std::wstring.
In other words it is impossible to specify default_value for wstring option.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net