Re: Static members comparison
"Dinesh Deva" <email@example.com> wrote...
> I have a class called Parser and a static member in it called Tree
> class Parser
> static Tree* ptree;
> void parse();
> Now i build the tree in a variety of ways (parsing different) kinds of
> eg AParser, BParser deriving from Parser.
> I want to compare the trees built by AParser and BParser. If the tree
> was not a static member, then i could do this.
> AParser ap;
> BParser bp;
> But since it is static both the parsers will build the same tree.
> (replace the old tree).
> How do i compare the trees?
> I know one way to do it is to do a deep copy of the tree. (this is the
> long route).
> Is there any easier way?
Make the parser compare as it builds? Move the 'ptree' out of
the 'Parser' into 'AParser' and 'BParser'?..
|All times are GMT. The time now is 04:52 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.