CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    87

    Private vs protected inheritance

    Can you please share example to clearly indicate when private and protected inheritance is used?

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: Private vs protected inheritance

    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  3. #3
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: Private vs protected inheritance

    Look towards the end of this example -
    Why do my compiles take so long?
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

  4. #4
    Join Date
    May 2009
    Posts
    2,413

    Re: Private vs protected inheritance

    Quote Originally Posted by [email protected] View Post
    Can you please share example to clearly indicate when private and protected inheritance is used?
    I think you should turn the page and come back to this later when you feel a need for something in between public and private inheritance.

  5. #5
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: Private vs protected inheritance

    Quote Originally Posted by nuzzle View Post
    I think you should turn the page and come back to this later when you feel a need for something in between public and private inheritance.
    Good point. Once you turn that page, more likely than not you will never need to go back and read it.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  6. #6
    Join Date
    May 2009
    Posts
    2,413

    Re: Private vs protected inheritance

    Quote Originally Posted by souldog View Post
    Good point. Once you turn that page, more likely than not you will never need to go back and read it.
    I must have skipped something like 90% of the C++ pages and here I am writing perfectly fine C++ programs!

    One big advantage of being a 10% C++ programmer is that your code is easy to read and understand by a majority of other C++ programmers as well.

    And even Stroustrup, the inventor of C++, is concerned that C++ has become too complex and hard to learn. I say that's no problem. For the 10% C++ programmer C++ is an easy language to learn and use.

  7. #7
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Private vs protected inheritance

    Quote Originally Posted by nuzzle View Post
    I must have skipped something like 90% of the C++ pages and here I am writing perfectly fine C++ programs!
    I would say that if you are only familiar with 10% of something, you are not really qualified to decide how “fine” your product is.
    For comparison, let’s say an average English-speaking person uses 50,000 words. If you only know and use 5,000 – you WILL be “easy to read and understand” (you are correct here). But it will be hard for you to express any non-trivial thoughts.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  8. #8
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Private vs protected inheritance

    Quote Originally Posted by VladimirF
    I would say that if you are only familiar with 10% of something, you are not really qualified to decide how “fine” your product is.
    For comparison, let’s say an average English-speaking person uses 50,000 words. If you only know and use 5,000 – you WILL be “easy to read and understand” (you are correct here). But it will be hard for you to express any non-trivial thoughts.
    I interpreted nuzzle's 10% as being 10% of the entire C++, so it would be akin to using 50000 words like the average person instead of the hypothetical 500000 words of the language. Of course, a percentage of C++ can only be a rough estimate, and a figure as low as 10% is probably an exaggeration to get the point across.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured