Boost Users :
From: Marty Fried (public.forums_at_[hidden])
Date: 2008-06-26 11:54:35
Back on Wed, 25 Jun 2008 09:47:16 +0400, in
gmane.comp.lib.boost.user,Vladimir Prus <vladimir_at_[hidden]> wrote:
>Marty Fried wrote:
>> My app has a configuration file. We don't know where it will be for sure, so
>> we are planning to make the location of the file a commandline option.
>> So, after reading the commandline option, we will want to parse the config
>You don't need to call 'notify' twice -- first, parse the command line (including
>calling 'store' put the option into variables_map). Obtain the value of the
>necessary option from the variables map, and if necessary, parse the
>config file, again, including 'store' like:
> store(parse_config_file(ifs, config_file_options), vm);
>After that, call 'notify(vm)' -- once.
Thanks a lot; I didn't know the purpose of notify, and thought it might be
necessary to get the data into the variables_map. This way makes sense to
>I don't think that anything will break *now*, if you call notify twice, but then,
>the documentation say:
> /** Specifies a function to be called when the final value
> is determined. */
> typed_value* notifier(function1<void, const T&> f)
>and reporting the *final* value twice seems weird.
That's the reason I didn't want to simply try it and assume the result is
Far be it for me to do something weird. :-)
Thanks for your input.
-- Marty Fried Senior software engineer Aldon http://www.aldon.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net