
Zachary Turner wrote:
On Mon, Nov 30, 2009 at 4:37 PM, John Bytheway <jbytheway+boost@gmail.com<jbytheway%2Bboost@gmail.com>
wrote:
Jeffrey Bosboom wrote:
As a technical question, how are the operators found? They can't be added to std (adding to std is undefined behavior), and there's otherwise no one namespace to put them in that will allow them to be found for all element types (at least with my understanding of ADL). The operators are added to namespace std, and they are found through ADL. I don't know how to make this work otherwise. You could put them in the global namespace? I think that would conform better to the letter of the rules, without really being any safer in
Jeffrey Faust wrote: practice.
I'd rather put them in a library specific namespace in that case, and require the programmer to put a using declaration in the translation unit.
That's the way Boost.Assign does it, and is the way to go IMHO.