473,769 Members | 5,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

boost::program options

3 New Member
hi

i'm using the boost::program_ options and i'm having some problems with syntax:

the code in question is the following:

vector<string> opt;
po::options_des cription desc("Usage");
desc.add_option s()
("help,h", "Print help message.")
("compl,c", "Print in complemented phase.")
("nodes,n", po::value<vecto r<string> > (&opt)->default_value( "*"), "Name of node(s) to print.")
;

usr/local/include/boost-1_33_1/boost/program_options/value_semantic. hpp:152: note: candidates are: boost::program_ options::typed_ value<T, charT>* boost::program_ options::typed_ value<T, charT>::default _value(const T&) [with T = std::vector<std ::string, std::allocator< std::string> >, charT = char]


basically i want to assign the "nodes,n" option a default value of "*" but i'm not sure what the correct syntax is. i'm trying (&opt)->default_value( "*") but i'm getting compiler errors. can anyone help me out on this?

thanks
pallav
Apr 7 '07 #1
0 2347

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3100
by: Stephen Horne | last post by:
I started making up a Python extension module to wrap a C++ library of mine using Boost Python. Trouble is, the library has a number of classes each of which has a lot of methods. I seem to have hit an internal limit in the Visual C++ 7 compiler. The output I get is... """ ....found 2031 targets... ....updating 4 targets...
7
1834
by: Jason Heyes | last post by:
I have a class with an expensive copy, read and write. There are many objects of this class used throughout my program. What kind of encapsulation of this class do I use to make sure copy, read and write are optimised in my program? Thanks.
1
7791
by: Hardy | last post by:
Hi, just come into the boost world. just the first.cpp in the program_options examples, with many link error... devc++4.9.9.2, gcc 3.4.2, can I get your opinions on this problem? thank you~ make.exe -f "D:\temp\Makefile.win" all g++.exe -c main.cpp -o
2
2456
by: Starfox | last post by:
The Following Code: //Setup the options string InputName, OutputSkeletonName, OutputModelName; program_options::options_description OptionDesc("Available Options"); OptionDesc.add_options() ("help", "produce help message") ("input,I", program_options::value<string>(&InputName), "Input md5mesh File") ("out-skl,S", program_options::value<string>(&OutputSkeletonName),
1
5386
by: cesco | last post by:
Hi, I'm using the boost library program_options for parsing the command line given to my program as described in the class Parameter: // Main.cpp #include "Parameter.h" using namespace std; int main(int ac, char* av)
1
12745
by: 张沈鹏 | last post by:
How to compile the HelloWorld of boost.asio? Maybe this is a stupid problem , but I really don't konw how to find the right way. My compile environment is WinXP, Msys , MinGw , G++ 3.4.2, Boost 1.33.1,
5
5402
by: Seth | last post by:
I can't get this thing made for the life of me. I've gone through every step per the Boost website regarding using bjam. Nothing. Can anyone give any advice or are there pre-made boost hpps for Windows platform? thanks in advance seth
8
3289
by: barcaroller | last post by:
Is there a recommended method of parsing program input parameters/options in C++ programs? The three methods that I know of are: - C's getopt() and getopt_long() - GNU C++ GetOpt class - Boost.Program_options class library
3
3113
by: Travis | last post by:
I'm trying to figure out how to use Boost? For example, I'd like to use the is_equal function to test two strings but I can't figure out exactly what to include or how to call the method. http://www.boost.org/doc/html/boost/algorithm/is_equal.html I know the boost libraries are installed.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.