[pooma-dev] std:: Policy for PoomaOps.in?
Gabriel Dos Reis
gdr at codesourcery.com
Tue Jul 10 20:12:17 UTC 2001
James Crotinger <JimC at proximation.com> writes:
| int main()
| {
| MySpace::A<int> a(1);
| MySpace::A<int> b(2);
|
| MySpace::A<int> c = sum(a,b);
|
| cout << "A(1) + A(2) = " << c.t_m << endl;
|
| cout << "1 + 2 = " << MySpace::sumInt(1,2) << endl;
|
| return 0;
| }
|
| The line of note is "c = sum(a,b)". If Koenig lookup is implemented, the
| function "sum" does not need to be qualified with MySpace::, unlike the call
| to sumInt, which does need to be qualified.
|
| This appears to work with GCC 2.95, but I seem to recall that there are
| problems with its implementation. Marks says 3.00 works.
Well, I guess I created some confusion with my nuance on Mark's
statement. Koenig lookup was implemented in GCC-2.95, but there were
some problems (which are now corrected in GCC-3.0). To have Koenig
lookup work well in generic codes, one often needs to bring in scope
some symbols which could be not be found otherwise. The natural
mechanism for that is a using-declaration. But the problem with GCC-2.95
was that using-declarations in function templates were simply ignored.
That is no longer the case with GCC-3.0.
Hope I cleared the confusion I created,
-- Gaby
More information about the pooma-dev
mailing list