Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1632: Encapsulate field for static variables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Frunobulax
Ketchup Master

84 Posts

Posted - Apr 14 2008 :  06:17:18 AM  Show Profile  Reply with Quote
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

"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Apr 14 2008 :  11:38:45 AM  Show Profile  Reply with Quote
That makes sense. I have put in a feature request for this:

case=15983

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000