views:

105

answers:

1

I've done enough Googling to know that if I have something like

class SubObject {

public:
//blah blah blah
};

class Aggregate {
public:
   boost::shared_ptr<SubObject>   m_ptr;
};

I can get Doxygen to create the "correct" collaboration diagram if I have a dummy declaration like

namespace boost { template<class T> class shared_ptr { T *dummy; }; }

in my header file.

My question is: how do I get that to work over all my projects and all my headers, without having to actually include that line in every file?

A: 

Heh.... I feel stupid answering my own questions, but I figure this one out pretty much right after posting it:

Put the code snippet

namespace boost { template<class T> class shared_ptr { T *dummy; }; }

in a header file, called something like "doxygen_dummy.h", and make sure it's included in your project's workspace or directory. You don't need to actually #include it anywhere (in fact, you don't want to, to avoid violating the One Definition Rule). You just need for Doxygen to be able to see it when it scans all your files.

Eric H.