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,842 of 33,346   
   Zeljko Vrba to Mathias Gaunard   
   Re: What will keep C++ going, given that   
   24 Jan 12 13:55:39   
   
   70428d8b   
   From: mordor.nospam@fly.srk.fer.hr   
      
   On 2012-01-24, Mathias Gaunard  wrote:   
   >   
   > Real code uses meaningful identifiers for free function names.   
   >   
   A simple and less contrived example with meaningful names follows.  Also, a   
   script-based solution cannot "go to definition" of pair_less in some given   
   code-context.  Just writing a regexp that is able to reliably find a   
   *definition* of a named function/method (vs. *use*) takes more time and   
   effort than I'm willing to spend.   
      
   /// File 1:   
      
   typedef std::pair ii_pair;   
      
   bool pair_less(const ii_pair &p1, const ii_pair &p2)   
   {   
     return p1.first < p2.first;   
   }   
      
   /// File 2:   
      
   typedef std::pair if_pair;   
      
   bool pair_less(const if_pair &p1, const if_pair &p2)   
   {   
     return p1.first != p2.first ? p1.first < p2.first : p1.second < p2.second;   
   }   
      
      
   --   
         [ 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