
Vladimir Prus writes:
3. In this code:
void typed_value
::notify(const boost::any& value_store) const { - const T* value = boost::any_cast<const T>(&value_store); + const T* value; + if (value_store.empty()) + value = boost::any_cast<const T>(&m_implicit_value); + else + value = boost::any_cast<const T>(&value_store); if (m_store_to) { *m_store_to = *value; } why value_store can end up being empty? I would expect that the xparse method, in the event that no explicit value is provided, would store m_implicit_value in value_store. The way you do this, it seems that the right value will be stored by 'notify', but the value stored to variables_map will be wrong.
I think you are correct about this.
6. I'd surely appreciate a test ;-)
Do you think you can adjust the patch per above? Clearly, I'd need to code qu estions to be settled before applying this. I'd very much like test/comment changes too, but if you're out of time we can skip them.
I've created a new patch that I think takes all your suggestions into account. I have modified 'example/options_description.cpp' to test it. I also added tests to 'test/variable_map_test.cpp', but I don't know how to compile/run it. The new patch has been added to ticket #1131. Regards, Bryan