
On Thursday 24 April 2008 08:06:12 am dizzy wrote:
Actually directly using some class that changes implementation details (private members are added, modified, deleted) without recompilation of all involved parts leads to violation of ODR and thus UB.
If the size of the object changes, all ABI bets are off. If you use boost in a library (not an application) that you supply as headers + precompiled binary library, you must avoid using components from boost libraries (even if they are header-only) as: 1. Members in your classes 2. Direct arguments to member functions If the size of a shared_ptr changed, the size of any class that contains a shared_ptr member also changes. Because of this issue, many libraries (such as those built on SystemC) include their own private (and usually incomplete) copy of boost. When using two such libraries in a project, all hell breaks loose when components in neither library but which could depend on common components in both libraries are used. Worse, when the libraries are header only, it is very easy to overlook this problem, especially since the compiler/linker does not provide any warnings. I have been lucky enough that all issues have been fixable in the past couple of years, but eventually I will get a library vendor who uses boost, but will not provide source even under an NDA (or even worse, out of business), and then it will be a huge problem. It is already pretty hard to maintain internal forks of such libraries (even if the differences are only minor). Regards, Ravi