H
Hans De Winter
Why does my compiler complain with the message "`int*My::Test::_shape'
is private" when I try to compile the following code? It seems it has
something to do with the namespace since when I leave that out then
everything works fine.
Many thanks for your help.
Hans
// START CODE
#include <iostream>
namespace My
{ // Begin of namespace 'My'
class Test
{
private:
int* _shape;
public:
friend std:stream& operator<<(std:stream&, Test&);
};
} // End of namespace 'My'
std:stream& operator<<(std:stream& s, My::Test& t)
{
t._shape = 0;
return s;
}
int main(int argc, const char* argv[])
{
return 0;
}
// END CODE
is private" when I try to compile the following code? It seems it has
something to do with the namespace since when I leave that out then
everything works fine.
Many thanks for your help.
Hans
// START CODE
#include <iostream>
namespace My
{ // Begin of namespace 'My'
class Test
{
private:
int* _shape;
public:
friend std:stream& operator<<(std:stream&, Test&);
};
} // End of namespace 'My'
std:stream& operator<<(std:stream& s, My::Test& t)
{
t._shape = 0;
return s;
}
int main(int argc, const char* argv[])
{
return 0;
}
// END CODE