Why doesn't this work ?
//file1.hpp
#include <vector>
namespace std
{
typedef vector<int> IntVec;
}
//file2.hpp
//forward declare IntVec
namespace std {
class IntVec;
}
class MyClass {
std::IntVec* myVec;
public:
MyClass();
};
#include "file1.hpp"
//file2.cpp
MyClass::MyClass()
{
myVec = new std::IntVec;
}
Visual studio errors with 'std::IntVec' redefinition, different basic types; no appropriate default constructor.
What I am interested in is forward declaring Boost severitly logger
//i want to do this so that I don't need to include boost log headers in my headers
typedef boost::log::sources::severity_logger<SeverityLevel> MyLogger