[program_options] Problem using value<string>()->zero_tokens() with config file
Hi,
I have the following code section:
po::options_description config;
config.add_options()
( "HOST", po::value<string>(&host) )
( "USER", po::value<string>(&user) )
( "PASSWD", po::value<string>(&passwd) )
( "DATABASE", po::value<string>(&database) )
( "PORT", po::value<int>(&port) )
( "VERTEX.WEIGHT", po::value<string>()->zero_tokens() );
po::variables_map vm;
ifstream ifs( "myfile.conf" );
store( parse_config_file( ifs, config ), vm );
notify( vm );
If in myfile.conf I leave WEIGHT blank like this
[VERTEX]
WEIGHT =
I get the following error message:
terminate called after throwing an instance of
'boost::exception_detail::clone_impl
' what(): no value given in 'WEIGHT =' Aborted
Someone can tell whats is wrong? Thanks Marcio
participants (1)
-
Marcio Paim de Aquino