
9 Apr
2010
9 Apr
'10
1:49 a.m.
Hello, I'm using boost::program_options to parse an command line within a running program (i.e. not just at startup, whenever a new command comes in), and am trying to avoid memory deallocation/reallocation. Is there any way reuse a variable_map that has already had options stored into it? If I use the std::map<>.clear() it seems to clear the stored values, but when I next try to parse, the results are still empty. I think this is happening because the m_final variable (as far as I can understand). Is there some reason why the variables_map can't be cleared and reused? thanks in advance for any insight you can provide, Jason.