Patrick Rammelt wrote:
Larry I Smith wrote:
'class' should not be required. In fact, it may
confuse the issue (on some compilers). Try:
A<T> & foo (X p) {
...
}
Yes, that works too. Thanks again. Now I have three working and one
non-working version:
Working:
class A<T>& foo (X p) { ... } // 1)
A<T>& foo (X p) {... } // 2)
A& foo (X p) { ... } // 3)
Not Working:
class A& foo (X p) { ... } // 4)
So is it a gcc-bug? In my opinion 3) and 4) should not behave
differently (I do not really understand why "class" confuses my new
little gcc).
Ciao,
Patrick
I'm going to go out on a limb here; I'm sure that smarter
folks will correct me if I'm wrong...
1) 'class' is redundant and un-necesary
2) declares that foo() returns a ref to an 'A<T>'
3) declares that foo() returns a ref to an 'A' whose 'T' is not
specified (similar to a base class??). not very useful?
You might get better (correct??) answers in the newsgroup:
comp.lang.c++
Some smart folks hang out there.
Regards,
Larry
--
Anti-spam address, change each 'X' to '.' to reply directly.
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus