I have written a code for a class which i have defined within a header file which is part of a namespace 'myns1',the memeber functions of the class are defined in a source file and then the main code is within another source file. I am able to get it to run on visual studio, but when i attempt to compile it within xcode i get an error on a function overloading the << operator. Within the header file i have declared it as a friend, coded as
As i said the whole code compiles fine within visual studio, but when i compile it in Xcode, i get the following error.
'std::ostream& myns1::operator<<(std::ostream&, const myns1::complex&)' should have been declared inside 'myns1'
As i said the class is part of a namespace myns1. I was just wondering if anybody might know if there is alternative method used in xcode when declaring certain functions.