home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,761 of 33,346   
   Martin B. to DeMarcus   
   Re: Are MACROS good and can the compiler   
   21 Dec 11 13:13:53   
   
   From: 0xCDCDCDCD@gmx.at   
      
   On 21.12.2011 12:19, DeMarcus wrote:   
   > On 12/20/2011 09:08 PM, Vladimir Jovic wrote:   
   >> On 20/12/11 08:55, DeMarcus wrote:   
   >>> Hi,   
   >>>   
   >>> I don't like macros.   
   >>> ...   
   >   
   > So why don't I like macros? Because once I bump into a function with big   
   > letters I get freezing cold because I have no idea whatsoever the   
   > programmer has been doing here. With a normal function I know the   
   > constraints. With macros there are no constraints.   
   >   
      
   Except of course that you can always check if the macro is well behaved   
   by looking at it, since it cannot be hidden.   
      
   > Take this Qt class for example, I found it here:   
   >...   
   > class Counter : public QObject   
   > {   
   > Q_OBJECT   
   >   
   >....   
   > public slots:   
   > void setValue(int value);   
   >   
   > signals:   
   > void valueChanged(int newValue);   
   >   
   > ...   
   > What's 'public slots:'? This is not C++. To me this is not intuitive to   
   > the next programmer that has to read the code.   
   >   
      
   No, this is not Standard C++, but *neither* is `public slots` a macro (I   
   think Q_OBJECT is one, but I'm not even sure about that).   
      
   Qt need a Meta compiler to generate valid C++ for the "real" compiler,   
   and this is the way things are with Qt. This has *nothing* to do with   
   whether macros are good or bad.   
      
   cheers,   
   Martin   
      
      
   --   
         [ 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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca