Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / December 2004



Tip: Looking for answers? Try searching our database.

Is GNU C++ or CW9 right?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hartwig Wiesmann - 17 Dec 2004 17:30 GMT
Assume I have the following class definition:

class Test
{
 // forward declaration of local class:
  class LocalClass;

public:
 // local class definition:
  class LocalClass
  {
  };
};

CW 9 does not complain.
GNU 3.x complains that "LocalClass" is private.

Who is right?

Hartwig
Hartwig Wiesmann - 17 Dec 2004 17:59 GMT
Sorry I forgot one part (inserted below).

Hartwig

> Assume I have the following class definition:
>
[quoted text clipped - 9 lines]
>   };
> };

int main(void)
{
  Test::LocalClass Variable;
  return 0;
}

> CW 9 does not complain.
> GNU 3.x complains that "LocalClass" is private.
>
> Who is right?
>
> Hartwig
MW Ron - 18 Dec 2004 16:47 GMT
>Sorry I forgot one part (inserted below).
>
[quoted text clipped - 24 lines]
>>
>> Who is right?

CW 9.3  gives

Error   : illegal access from 'Test' to protected/private member
'Test::LocalClass'
main.cpp line 18      Test::LocalClass Variable;

Ron

Signature

Metrowerks Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and Metrowerks' staff
       --   http://www.metrowerks.com/community  --

Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.