
On 16/03/2011 18:45, Ryan wrote:
In the boost library system certain libraries need to be compiled and linked into a project. For example, libraries would need to be compiled to remove cyclic header dependencies. In the boost library system I coundn't find any .cpp files that would indecate a compilable library. So how do library developers create compilable files in the boost libraries? The following two files would need to be broken up and compiled to remove the dependencies, correct? Ryan //File A.hpp class B; class A { double x; public: B convertToB(void) { return B(x); } }; //File B.hpp class A; class B { double y; public: A convertToA(void) { return A(y); } };
Just move the definitions of convertToB and convertToB to other files. Whether they're headers or not is irrelevant (you'll need to qualify inline explicitly if they're in headers though).