Inheritance in Pimpl idiom

Discussion in 'C Programming' started by George2, Mar 18, 2008.

  1. George2

    George2

    Joined:
    Feb 12, 2008
    Messages:
    108
    Hello everyone,


    Why it is useless for any inheritance in Pimpl idiom? Here is the source, but no detailed reasons are provided.

    http://www.gotw.ca/gotw/024.htm

    --------------------
    - make XImpl entirely the class that X would have been, and write X as only the public interface made up entirely of simple forwarding functions (a handle/body variant).

    This is useful in a few restricted cases, and has the benefit of avoiding a back pointer since all services are available in the pimpl class. The chief drawback is that it normally makes the visible class useless for any inheritance, as either a base or a derived class.
    --------------------


    thanks in advance,
    George
     
    George2, Mar 18, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Icosahedron

    Pimpl Idiom

    Icosahedron, Nov 20, 2003, in forum: C++
    Replies:
    7
    Views:
    739
    Icosahedron
    Nov 22, 2003
  2. Debajit  Adhikary
    Replies:
    2
    Views:
    2,088
    Christopher Benson-Manica
    Jul 15, 2004
  3. Peteris Krumins
    Replies:
    2
    Views:
    516
    Peteris Krumins
    Aug 31, 2005
  4. jimmy

    friendship and pImpl idiom

    jimmy, Feb 8, 2006, in forum: C++
    Replies:
    3
    Views:
    461
    Alf P. Steinbach
    Feb 9, 2006
  5. Noah Roberts

    pimpl idiom and singletons

    Noah Roberts, May 24, 2007, in forum: C++
    Replies:
    4
    Views:
    456
    Noah Roberts
    May 25, 2007
Loading...

Share This Page