Nested classes

I'm having trouble with the following:

1
2
3
4
5
6
7
8
9
10
template<typename T>
struct Outside {
   struct Nested {};
   Nested* f() {}
};

template<typename T>
Outside<T>::Nested*
Outside<T>::
f() {}


Line 8 error: expected constructor, destructor, or type conversion before '*' token

I don't understand why the error occurs or how to fix it and would very much appreciate help.
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18
1
2
3
4
template<typename T>
typename Outside<T>::Nested*
Outside<T>::
f() {}
Thank you for the quick answer, that solved the problem.
Topic archived. No new replies allowed.