Results 1 to 2 of 2

Thread: c++ nested class

  1. #1
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Wink c++ nested class

    Sir,
    I want to know that, in c++ how important is the use of nested class? Means that can we also do our work without the use of nested class. I have seen many examples but the use of nested class in c++ is very low. So is there any use of nested class? If yes then could you please give me an example on nested class?

    Thankyou

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: c++ nested class

    Quote Originally Posted by sonulohani View Post
    I want to know that, in c++ how important is the use of nested class?
    Important, that depends on whether you find the name hiding it provides useful or not. Other name hiding strategies include namespaces (used heavily in Boost) and the private implementation idiom (used heavily in Qt).
    Means that can we also do our work without the use of nested class. I have seen many examples but the use of nested class in c++ is very low.
    Uh huh.
    So is there any use of nested class? If yes then could you please give me an example on nested class?
    Yes. To provide a tenuous link between this post, which has nothing to do with Qt, and Qt QTextCodec has a nested class ConverterState. The STL-style iterators on Qt containers used a nested class "iterator" and "const_iterator".

    Why do I get the feeling this is an assignment question for school?

  3. The following user says thank you to ChrisW67 for this useful post:

    sonulohani (25th June 2012)

Similar Threads

  1. Inheritance of nested class
    By bibhukalyana in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2011, 18:54
  2. Nested Layout
    By starcontrol in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2008, 12:47
  3. nested tables
    By Jeroen van der Waal in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2007, 17:12
  4. Nested signals and slots
    By vishva in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2006, 09:47
  5. Nested Plugins
    By Luis Rodriguez in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2006, 22:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.