Does reordering public non-virtual methods in a stand-alone class break ABI?

The functions are linked by their name and signature, not by their position in the class. So no, you're not breaking the ABI.

Virtual functions are a different matter because they're linked by their position in a vtable (usually). This won't be a problem if you consistently recompile every file that depends on the header that defines the order, but if the class exists in a library it could be a concern.


There are two things that breaks the ABI when you update your classes. Virtual functions as pointed out by Mark (and remember that it is not because you did not mark a function as virtual that it isn't.)

The other things are inline functions because those make use of your variable members. If the order of your variable members changes then those inline's that were compiled in other software break too.

As pointed out by Russel Greene (see comment) the order of variable members can also cause alignment differences which is enough to change the size of the allocated objects. That also breaks your allocation (assuming the client's code uses new)

And adding/removing members may not break the ABI (you still could allocate a byte here or a word there...) but that's usually a deal breaker right there.