title: Pure virtual functions and binary compatibility
body: <p>Now, I know it is generally bad to add new virtual functions to non-leaf classes as it breaks binary compatibility for any derived classes which haven't been recompiled. However, I have a slightly different situation:</p>
  
  <p>I have an interface class and implementation class compiled into a shared library, for example:</p>
  
  <pre><code>class Interface {
      public:
          static Interface* giveMeImplPtr();
          ...
          virtual void Foo( uint16_t arg ) = 0;
          ...
  }
  
  class Impl {
      public:
          ...
          void Foo( uint16_t arg );
          ....
  }
  </code></pre>
  
  <p>My main application uses this shared library, and could basically be written as:</p>
  
  <pre><code>Interface* foo = Implementation::giveMeImplPtr();
  foo-&gt;Foo( 0xff );
  </code></pre>
  
  <p>In other words, the application doesn't have any classes which derive from <code>Interface</code>, it merely uses it.</p>
  
  <p>Now, say I want to overload <code>Foo( uint16_t arg )</code> with <code>Foo( uint32_t arg )</code>, am I safe to do:</p>
  
  <pre><code> class Interface {
      public:
          static Interface* giveMeImplPtr();
          ...
          virtual void Foo( uint16_t arg ) = 0;
          virtual void Foo( uint32_t arg ) = 0;
          ...
  }
  </code></pre>
  
  <p>and recompile my shared library without having to recompile the application?</p>
  
  <p>If so, are there any unusual caveats I need to be aware of? If not, do I have any other options other than to take the hit and up-version the library, thus breaking backwards compatibility?</p>