Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1632: Encapsulate field for static variables

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Frunobulax Posted - Apr 14 2008 : 06:17:18 AM
Hi,

if I encapsulate a static variable in VS2005 C++ then the generated member functions are not static. Thus, encapsulating


    static bool _foo;

will lead to

    bool getFoo() const { return _foo; }
    void setFoo(bool val) { _foo = val; }


but correct is

    static bool getFoo() { return _foo; }
    static void setFoo(bool val) { _foo = val; }

(static methods and no const).

Regards, tv
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 14 2008 : 11:38:45 AM
That makes sense. I have put in a feature request for this:

case=15983

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000