Vijay Samuel's Blog

The importance of notify()

Posted on: June 13, 2010

I recently refactored the drizzle client and came to know the importance of the program_options::notify(). Initially I was including this notify() blindly without knowing what it does but it turns out that it is very important when you use variable that make references to your variables map.
For instance, if you have an option like
(“foo”, po::value<string>(&opt_foo)->default_value(“”), “An option named foo”)

After your command line has been parsed, the notify does the job of assigning the argument of –foo to opt_foo.

I didn’t know this and spent hours together trying to find out why my variables weren’t getting the values coming in via the command-line. 🙂 Now that I ‘ve found out the importance of notify() I have one less bug to worry about in the future. 🙂 🙂


1 Response to "The importance of notify()"

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

My Timeline

June 2010
« May   Jul »

I, Me and Myself

My Blog Stats

  • 6,522 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4 other followers

%d bloggers like this: