Skip to content

ericniebler/abi_stable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABI-Stable Class Example

This repo contains some code that demonstrates how to design and implement a C++ class type that is ABI-stable. In other words, code that was compiled and linked with V1 of a library can be linked with V2 without recompilation. This only works if the layout of types is unchanged.

But that doesn't mean you cannot evolve the types. It is possible to hide the changes behind layers of indirection. This code shows how.

Contents

  • Widget.hpp: The header for an ABI-stable Widget type that changed from version 1 to version 2.
  • src/WidgetV1.*pp: The implementation of V1 of the widget type.
  • src/WidgetV2.*pp: The implementation of V2 of the widget type.
  • ThirdParty/ThirdParty.hpp: The header for a third-party library that was compiled and linked against V1 of the widget library, but that will now be linked against V2.
  • ThirdParty/src/ThirdParty.cpp: The implementation of a third-party library that was compiled against V1 of the widget library, but that will now be linked against V2.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published