Boost logo

Boost Users :

Subject: [Boost-users] Library Developers Battling Cyclic Header Dependency
From: Ryan (mccorywork_at_[hidden])
Date: 2011-03-16 13:45:41


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);
  }
};



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net