[program_options] std::wstring ??
I've tried using the std::wstring with program options, couldn't make it work, only with std::string. Any workarounds? TIA /R
Robert Bielik wrote:
I've tried using the std::wstring with program options, couldn't make it work, only with std::string. Any workarounds?
There's not enough information to answer. See http://www.chiark.greenend.org.uk/~sgtatham/bugs.html for some basic guidelines how to report problems. - Volodya
Vladimir Prus skrev:
Robert Bielik wrote:
I've tried using the std::wstring with program options, couldn't make it work, only with std::string. Any workarounds?
There's not enough information to answer. See
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
for some basic guidelines how to report problems.
Sorry, I thought it was pretty obvious. My bad, I'll elaborate: std::string strValue; po::options_description desc("Allowed options"); desc.add_options() ("help,h", "Produce help message") ("string,s", po::valuestd::string(&strValue), "A string value"); works, whereas: std::wstring strValue; po::options_description desc("Allowed options"); desc.add_options() ("help,h", "Produce help message") ("string,s", po::valuestd::wstring(&strValue), "A string value"); doesn't even compile on MS VS 2005 (Win XP) boost version 1.34.1. It should be very easy to test. /R
Robert Bielik wrote:
std::wstring strValue; po::options_description desc("Allowed options"); desc.add_options() ("help,h", "Produce help message") ("string,s", po::valuestd::wstring(&strValue), "A string value");
Did you read: http://www.boost.org/doc/html/program_options/howto.html#id1592999 It say to use 'wvalue' function, as opposed to 'value'. - Volodya
Vladimir Prus skrev:
Did you read:
http://www.boost.org/doc/html/program_options/howto.html#id1592999
It say to use 'wvalue' function, as opposed to 'value'.
Thanks, I feel silly :) Cool! /R
participants (2)
-
Robert Bielik
-
Vladimir Prus