Greetings Kind Regards re/ the code below take from the boost site https://www.boost.org/doc/libs/1_81_0/doc/html/program_options/tutorial.html#id-1.3.30.4.3
i am attempting to find documentation re/ the .as<int>() method near the bottom . it is called on a return from program_options::variables_map.operator [] which as near as i can discern returns an any<> type . however i could find no reference to as in boost documentation . Please advise Thank You Kindly
namespacepo=boost::program_options;//Declarethesupportedoptions.po::options_descriptiondesc("Allowed options");desc.add_options()("help","produce help message")("compression",po::value<int>(),"set compression level");po::variables_mapvm;po::store(po::parse_command_line(ac,av,desc),vm);po::notify(vm);if(vm.count("help")){cout<<desc<<"\n";return1;}if(vm.count("compression")){cout<<"Compression level was set to "<<vm["compression"].as<int>()<<".\n";}else{cout<<"Compression level was not set.\n";}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings Kind Regards re/ the code below take from the boost site https://www.boost.org/doc/libs/1_81_0/doc/html/program_options/tutorial.html#id-1.3.30.4.3
i am attempting to find documentation re/ the
.as<int>()
method near the bottom . it is called on a return fromprogram_options::variables_map.operator []
which as near as i can discern returns anany<>
type . however i could find no reference toas
in boost documentation . Please advise Thank You Kindly