Hi
I have some problems with a macro we use to declare typedefs for boost::shared_ptr and boost::weak_ptr. It's strange, the typedefs are sometimes listed, sometimes red underlined. But most of the times the intellisense doesn't work.
There is a header file "SmartPointerUtil.h":
namespace boost // fwd declaration
{
template<class T> class shared_ptr;
template<class T> class weak_ptr;
}
#define DECLARE_SMART_PTR(type)\class type;\typedef boost::shared_ptr<type> type##Ptr;\typedef boost::weak_ptr<type> type##WeakPtr;\typedef boost::shared_ptr<const type> type##PtrConst;\typedef boost::weak_ptr<const type> type##WeakPtrConst;
And there are header files with the declarations of all the pointers (called "Ptr.h" in the directory of the namespace):
#include "SmartPointerUtil.h"
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
namespace bl {
namespace fitting {
namespace slotconceptmodel {
DECLARE_SMART_PTR( Backend );
DECLARE_SMART_PTR( CommonEffectMap );
DECLARE_SMART_PTR( CommonHearingInstrument );
DECLARE_SMART_PTR( CommonModel );
DECLARE_SMART_PTR( CommonProductId );
// ....
}
}
}
I already tried to add this lines to the VA "Stdafx.h" or "StdafxVa.h", but without success:
#define DECLARE_SMART_PTR( type ) \class type;\typedef type* type##Ptr;\typedef type* type##WeakPtr;\typedef const type* type##PtrConst;\typedef const type* type##WeakPtrConst;
What can I do?