Re: [boost] Extending Boost.Program_options

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I forgot to mention that this is especially useful in my case, because then the UI can detect (some) wrong inputs and complain directly. I think one easy way to implement this would be to (1) pass a reference to value_semantic to the validation functions, (2) add a virtual is_correct function to value_semantic that defaults to accepting everything, (3) call value_semantic::is_correct in the validation functions, (4) subclass typed_value to hold a functor that is invoked upon overwritten is_correct, and (5) provide a checked_value function similar to value. (2), (4) and (5) are mostly trivial, and I'm happy to provide you a patch for that. (1) and (3) shouldn't be hard either, but require more invasive changes. - -- - -ness- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFF/+KlvD/ijq9JWhsRAuOLAJoCWeSVBukRRP+02h2N0bjOxr1PqQCcCtfe B8HQ3EzCP/E6vghOHo0faLI= =pE/C -----END PGP SIGNATURE-----
participants (1)
-
Tom Bachmann