POV-Ray : Newsgroups : povray.off-topic : This is the sort of brokenness... : Re: This is the sort of brokenness... Server Time
6 Sep 2024 19:20:04 EDT (-0400)
  Re: This is the sort of brokenness...  
From: Warp
Date: 19 Mar 2009 11:29:12
Message: <49c264c7@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> or the infamous "#define private public"

  Btw, if you *really* want to hide your private variables, there's a
technique used by some:

class MyClass
{
 public:
    // public functions here

 private:
    struct Members;
    Members* members;
};

  If the struct 'Members' is implemented eg. in a static or dynamically
loadable library, ie. you don't have the source code, it's extremely
difficult for anyone to even figure out what members there are in there
or how to access them. Your #define won't help at all here, nor accessing
the object by other means.

  You could, of course, take that pointer and start trashing the memory
it's pointing to, but that would be rather pointless. Certainly not useful.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.