program_options docs on options_description_easy_init( value_sema ntic * )

The class options_description_easy_init is supposed to provide "convenient creation syntax to option_description" but I find it's a bit less convenient than advertised. The problem is that the class isn't documented, and that's a serious problem if you take raw pointers. I found out that a value_semantic object was being desroyed by a shared_ptr<value_semantic> dtor, even though I had passed the address of a local object. Besides the fact that it's undocumented, shouldn't it take a shared_ptr<value_semantic> in the first place? The orginal owner miught like to keep a pointer to the object as well. ( I'm porting Wave to boost 1.32, so I'm not writing the program_options code from scratch. Even so, I found the documentation under par - wouldn't use it myself. For instance, the 'overview' section talks a lot about the value_semantic class but uses the value<T> class. ) Regards, Michiel Salters This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

Michiel Salters wrote:
This usage was never intended, and docs should say this.
Why? Can you explain what are you trying to do?
( I'm porting Wave to boost 1.32, so I'm not writing the program_options code from scratch.
Porting to 1.32? I though it works with 1.32 already...
There's no 'value<T>' class! There's value<T> *function* which produces instances of class derived from 'value_semantic<T>'. - Volodya
participants (2)
-
Michiel Salters
-
Vladimir Prus