From: 0xCDCDCDCD@gmx.at   
      
   On 06.06.2012 06:31, Dave Abrahams wrote:   
   > on Tue Jun 05 2012, Mathias Gaunard wrote:   
   >   
   >> On Jun 5, 3:43 am, "Martin B."<0xCDCDC...@gmx.at> wrote:   
   >>   
   >>> # Question First   
   >>>   
   >>> Is there an elegant solution in C++ to prevent one from having to   
   >>> declare complex object variables that are only used within a loop   
   >>> outside of the loop for efficiency reasons?   
   >>   
   >> No. The only alternative I can think of is to not use loops, but   
   >> rather algorithms.   
   >   
   > By which I think you mean "yes" :-). Algorithms are an elegant   
   > abstraction that can hide the lack-of-elegance that may be required to   
   > achieve efficiency.   
   >   
      
   Mathias, Dave - I fail to see how an algorithm could help. I really   
   don't get it.   
      
   Can you provide an example where an algorithm based solution avoids the   
   inefficiencies associated with declaring the temporary complex object   
   inside the loop body?   
      
   cheers,   
   Martin   
      
   --   
   Good C++ code is better than good C code, but   
   bad C++ can be much, much worse than bad C code.   
      
      
    [ 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)   
|