On 2 Apr 2010, at 17:59, Matthias Melcher wrote: > > Looking at fltk-2, Bill already saw (and solved) the issue:
OK - that looks like the way to go for fltk3 to, then, I guess? >> (I bloody hate "using namespace blah" by the way... It completely >> negates the usefulness of namespaces...) > > It is entirely optional. The better option is probably to write > something like "namespace fl = fltk3;" and easily upgrade to fltk4 > later... Could be - though I think, at least for the examples, we should set a "good example" by *not* setting: "using namespace fltk3" or etc. at the top of the files, and we should write everything out long-hand to make it explicit what we are doing. Yes, that's a bunch more typing in the examples, but I just feel it would be "more correct"... Also, in the specific case of hello[3].cxx (and hello2.cxx) if we had done that, then the collision between fltk3::Window and the X11 Window would be avoided, since our calls to fltk3::Window would be unambiguous. That's what namespaces are meant to fix, surely? But since the examples (and pretty much all the C++ code with namespaces I've ever seen) just set the "using namespace xyz" thing at the head of the file, the ambiguity is not resolved, and the code fails to compile.... And that's why I often think that the whole C++ approach to namespaces is basically bogus, since it seems that it mainly is subverted in such a way that it doesn't actually work. In which case, what is the point of it? Rant over. Sorry... _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
