From: Shigeru C. <ch...@is...> - 2002-10-22 07:16:35
|
From: Jean-Sebastien Mouret <js...@lr...> Date: 22 Oct 2002 06:57:25 +0200 From: Jean-Sebastien Mouret <js...@lr...> Date: 22 Oct 2002 05:01:54 +0200 > Here is a very small patch to fix struct's members default access. > As seen somewhere in the iso c++ standard: > "Members of a class defined with the keyword class are private by > default. Members of a class defined with the keywords struct or > union are public by default." Oups, sorry. First patch, first mistake. Here follows the correct code to handle both struct and union properly. --=-=-= Content-Disposition: attachment; filename=member.cc.diff --- src/member.cc 2001-12-10 05:23:25.000000000 +0100 +++ src/member.cc.new 2002-10-22 02:17:21.000000000 +0200 @@ -553,7 +553,7 @@ void MemberList::AppendThisClass(Class* metaobject) { - int access = PRIVATE; + int access = (Ptree::Match(metaobject->Definition()->First(),"class") ? PRIVATE : PUBLIC); Ptree* user_access = nil; Ptree* members = metaobject->Members(); while(members != nil){ --=-=-=-- -- js...@lr... "creating the future" (c) framfab |