having error with implementing template function which returns reference value

Apr 7, 2012 at 2:43am
This is part of a code.
I am trying to make a stack from List STL.
This is a practice although I know that there is stack STL :))

template<typename T>
&T stackL<T>::top(){
}

the compiler shows that there is an error at the underlined word and asks for ';' .

How to solve this problem?

Thank you very much :))
Apr 7, 2012 at 2:46am
Is stackL spelled correctly? Also, &T should be T&.
Apr 7, 2012 at 2:54am
Yes... correctly

I names my class as stackL


oops. :P careless mistacks

thank you very much :)) now the problem is solved
Topic archived. No new replies allowed.