G
George Economos
Hi all,
I am using msvc 7.1 and have encountered the following code:
-----------
A.hpp
-----------
class A
{
public:
class Vector : public std::vector< std:air< int, bool > >
{
friend std::istream & operator>>(
const std::istream & is, Vector & v );
friend stdstream & operator<< (
const std:stream & os, const Vector & v );
};
const Vector & GetVector() const { return v; }
private:
Vector v;
};
-----------
B.hpp
-----------
namspace BLib
{
class B
{
void SomeFunc();
};
}
-----------
B.cpp
-----------
#include "B.hpp"
#include "A.hpp"
using namespace BLib;
void B::SomeFunc()
{
A a;
std::strstream ss;
ss << a;
}
When I try and compile B.cpp the compiler complains that it cannot
find a suitable overload for operator << that takes a right hand
argument of Vector (more specifically vector< pair< int, bool > > )
(C2679). If I remove class B from namespace BLib it compiles fine.
What am I doing wrong?
Thanks,
George Economos
I am using msvc 7.1 and have encountered the following code:
-----------
A.hpp
-----------
class A
{
public:
class Vector : public std::vector< std:air< int, bool > >
{
friend std::istream & operator>>(
const std::istream & is, Vector & v );
friend stdstream & operator<< (
const std:stream & os, const Vector & v );
};
const Vector & GetVector() const { return v; }
private:
Vector v;
};
-----------
B.hpp
-----------
namspace BLib
{
class B
{
void SomeFunc();
};
}
-----------
B.cpp
-----------
#include "B.hpp"
#include "A.hpp"
using namespace BLib;
void B::SomeFunc()
{
A a;
std::strstream ss;
ss << a;
}
When I try and compile B.cpp the compiler complains that it cannot
find a suitable overload for operator << that takes a right hand
argument of Vector (more specifically vector< pair< int, bool > > )
(C2679). If I remove class B from namespace BLib it compiles fine.
What am I doing wrong?
Thanks,
George Economos