From: Al S. <al...@al...> - 2002-12-03 11:30:50
|
That's what it is, all right. Thanks. I keep forgetting about Koenig lookup, and I keep getting fooled by it. That's because I've never read a cogent explanation of what problem it solves. Another reading assignment, I fear. Al Stevens ----- Original Message ----- From: "Esa Vuokko" <eiv...@bo...> To: "Al Stevens" <al...@al...>; <min...@li...> Sent: Monday, December 02, 2002 4:56 PM Subject: Re: [Mingw-users] Other algorithm functions in the global namespace? > Al Stevens wrote: > | I'm using 3.2. Try this one: > | > | #include <vector> > | #include <algorithm> > | > | int main() { > | std::vector<int> vi(10); > | std::vector<int>::iterator k; > | fill(k, k + 10, 0); > | } > | > | All the algorithm functions, when used with STL iterators, seem to be in > the > | global namespace. That's a bug. > > > It's called argument dependant name lookup aka Koenig > lookup. See 3.2.4 in standard. > > In principle, it searches namespaces where arguments are > located for to find the function. This is quite nicely explained > by Herb Sutter here : > http://www.gotw.ca/gotw/030.htm > > HTH, > Esa > > ---------------------------------------------------------- > Esa Ilari Vuokko +358-50-544 8847 > esa...@bo... > Bonum IT Oy www.bonumit.com > ---------------------------------------------------------- > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Get the new Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |