This example shows a function named validate
defined at global scope overloading a function in the boost::program_options
namespace.
What justifies this design using a global function to overload? Why is a more tightly-scoped design not implemented by boost::program_options
instead (e.g. overriding a class method, or some other scheme)?
As noted in comments below, my main concern is really that a user might be surprised to find that one of their global functions is being called by the library.
It should be emphasized that namespaced free functions are extremely important (as opposed to global-scope free functions, see this link provided by Chris Drew). Indeed, namespaced, non-class (free) functions are IMO a major benefit of C++.
My company is considering a major adoption of Boost, it seems to be highly regarded. But, this particular design decision has me concerned.