Reputation: 12904
In gcc I am writting friend class FriendMaker<T>::Type
but Visual Studio wants friend FriendMaker<T>::Type
. So I think it is time to go compiler specific.
So What I need to ifdef
for Visual Studio
? I am using 2010 at the moment but I may switch to 2012 latter.
Upvotes: 6
Views: 8976
Reputation: 1
I think you need to use following code for cross compiler:
template <typename T> class B;
template <typename T>
class A
{
friend typename B<T>::V;
};
Upvotes: 0
Reputation: 263627
Just use the friend class ...
syntax for both compilers. The friend ...
syntax, without the class
keyword, is actually invalid; VS2010 is incorrect in not complaining about it.
See this question.
Upvotes: 0