l-september.org> 9ca22255   
   From: francis.glassborow@btinternet.com   
      
   On 20/09/2013 22:53, Tobias Müller wrote:   
   >   
   > Seungbeom Kim wrote:   
   >> On 2013-09-17 23:16, DeMarcus wrote:   
   >>>   
   >>> Global variables are "evil" but global /objects/ are not.   
   >>   
   >> What is a global object and how is it different from a global variable?   
   >>   
   >> I cannot make sense of the distinction, because when you say "global"   
   >> in C++ it always refers to something related to scope ("global scope"   
   >> or "global namespace", etc.), which is a property of a name, which in   
   >> turn is introduced by a variable, not an object. So, you can have a   
   >> global name or a global variable, but not a global object: properties   
   >> of an object include storage duration and lifetime, but not scope.   
   >   
   > I'm not the OP but my guess is, that with "global object" he means an   
   > object that is available globally, but not by its variable name but by   
   > other means, e.g. by a global function.   
   >   
      
   No, I am pretty sure that he is contrasting objects with constructors   
   with the data encapsulated v objects with public access and so nothing   
   to enforce invariants. But I could be wrong (not for the first time.)   
      
   Francis   
      
      
   --   
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|