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,590 of 33,346   
   red floyd to late-enthusiast   
   Re: Template-based code doesn't compile   
   29 Oct 11 10:37:44   
   
   02de9003   
   From: no.spam.here@its.invalid   
      
   On 10/29/2011 1:20 AM, late-enthusiast wrote:   
   > Hi   
   >   
   > I can't compile the following code (with gcc 3.4.4):   
   >   
   > I have this code in the "totals.h" file:   
   >   
   > // beginning of totals.h   
   >   
   > #include   
   > using namespace std;   
      
   Do not put a using namespace directive in an include file.   
   It's bad form.  It means that any include file that follows   
   it gets "using namespace std" whether it wants it or not.   
   Bite the bullet and put std:: in there.  It makes your code   
   more readable and maintainable in the long run.   
      
   >   
   > #ifndef __TOTAL_H_   
   > #define __TOTAL_H_   
      
   Totally unrelated, but your code is ill-formed.   
   Identifiers beginning with either two underscores,   
   or an underscore followed by an uppercase letter, are   
   reserved to the implementation, and the implementation only.   
      
   You may not use them for your own purposes (such as include   
   guards).   
      
   [redacted]   
      
      
   --   
         [ 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