Author: | Michał Górny |
---|---|
Date: | 20 Aug 2012 |
Copyright: | http://creativecommons.org/licenses/by/3.0/ |
Source: | http://dev.gentoo.org/~mgorny/articles/the-impact-of-cxx-templates-on-library-abi.rst |
Preamble
The general aspect of maintaining binary compatibility of C++ library interfaces has been already covered thoroughly multiple times. A good reference of articles on the topic can be found on wiki page of ABI compliance checker tool [1]. Sadly, those articles usually consider the topic of C++ templates only briefly, if at all.
While in fact the topic is fairly complex, and I believe that considering the overall usefulness and popularity of the templates, it should be considered more thoroughly. Thus, in this article I will try to address the issues arising from use of templates, methods of dealing with them and trying to prevent them.
Both the overall topic of templates in respect to the programming techniques, and the wide topic of ABI are already explained in detail in many other articles and guides. Moreover, I believe that myself I am not fluent enough to be able to cover those topics in detail here. Thus, I will assume that a reader of this article is already familiar with both the general topic of templates in C++, and the basic aspects of an ABI and its compatibility.
Moreover, in the solutions and problems listed here I will assume that a particular toolchain in question does conform to the C++98 standard, and is able to properly support templates with regard to multiple instantiations.
[1] | http://ispras.linuxbase.org/index.php/ABI_compliance_checker#Articles |
Continue reading “The impact of C++ templates on library ABI”