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. 🙂 🙂

Advertisements

1 Response to "The importance of notify()"

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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
M T W T F S S
« May   Jul »
 123456
78910111213
14151617181920
21222324252627
282930  

I, Me and Myself

My Blog Stats

  • 6,358 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: