Boost logo

Boost Users :

Subject: Re: [Boost-users] [program_options] Clearing variables_map
From: Jason Reich (jreich_at_[hidden])
Date: 2010-04-09 14:08:19


"Vladimir Prus" <vladimir_at_[hidden]> wrote in message
news:hpmi0m$ei2$1_at_dough.gmane.org...
> Jason Reich wrote:
<snip>
>> Is there some reason why the variables_map can't be cleared and reused?
>
> Why do you think that calling clear() and using the same variables_map
> again
> will cut down on memory deallocation/reallocation? It does not seem
> obvious
> to me that it will.
>
> - Volodya

Hi Volodya,
I know there will be memory allocation behind the scenes, but I think it
would simplify the option processing if each processor could reuse an
object, rather than having to delete and reallocate one each time a command
arrives. Like a regular std::map, the variable_map it can be cleared, but
it can't be reused.

Also, many of the classes within program_option use private members and
methods that limit the ability for the classes to be extended. Is there any
reason why they weren't made protected to better allow extension?

thanks
Jason.


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