[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nested classes style question

From: John W. Eaton
Subject: Re: nested classes style question
Date: Thu, 16 Nov 2017 17:01:20 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 11/16/2017 01:13 PM, John W. Eaton wrote:
Back in the day, I thought nested classes were cool.  I thought using them would help describe the structure of a program by saying "this object is clearly part of this other object".  Maybe that's true when the nested class is never used independently outside of the parent class.  But now they just seem to serve to clutter class declarations and cause a lot of extra overhead that doesn't add much clarity.

I'm thinking specifically of the scope and symbol_record classes that are nested inside the symbol_table class.  Would anyone object to moving the symbol_record and scope classes to separate files and declaring them outside of the symbol_table class?  As far as I can see, backward compatibility with the old symbol_table::scope or symbol_table::symbol_record can be handled with a couple of typedefs.

Comments or suggestions?


I pushed this changeset:


If there are any objections, we can discuss and change as needed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]