Click here to Skip to main content
15,899,313 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: STL Algorithms Pin
Zac Howland13-Sep-06 3:24
Zac Howland13-Sep-06 3:24 
GeneralRe: STL Algorithms Pin
Stephen Hewitt13-Sep-06 14:14
Stephen Hewitt13-Sep-06 14:14 
GeneralRe: STL Algorithms Pin
Zac Howland13-Sep-06 18:32
Zac Howland13-Sep-06 18:32 
GeneralRe: STL Algorithms [modified] Pin
Stephen Hewitt13-Sep-06 19:32
Stephen Hewitt13-Sep-06 19:32 
GeneralRe: STL Algorithms Pin
Zac Howland14-Sep-06 3:13
Zac Howland14-Sep-06 3:13 
GeneralRe: STL Algorithms Pin
Stephen Hewitt14-Sep-06 13:50
Stephen Hewitt14-Sep-06 13:50 
GeneralRe: STL Algorithms Pin
Zac Howland14-Sep-06 19:17
Zac Howland14-Sep-06 19:17 
GeneralRe: STL Algorithms Pin
Stephen Hewitt14-Sep-06 19:27
Stephen Hewitt14-Sep-06 19:27 
Well it seems to be a mistake or an oversimplification. From the code I posted here[^] it can be seen that:
 1. Both the function and functor versions produce exactly the same code.
 2. Both versions have no call instructions.
 3. The add and imul instructions which do the actual math can be seen in place.

I often find it enlightening to look at the code generated by the compiler. One surprise I had recently was when I was evaluating the Boost BOOST_FOREACH macro. Although when you look at the source there is a fair bit of code behind it, when I actually looked at the code generated in a release build it was actually smaller and more efficient then a hand written loop.



Steve

GeneralRe: STL Algorithms Pin
Zac Howland13-Sep-06 3:21
Zac Howland13-Sep-06 3:21 
AnswerRe: STL Algorithms Pin
Kevin McFarlane13-Sep-06 4:08
Kevin McFarlane13-Sep-06 4:08 
GeneralRe: STL Algorithms Pin
Zac Howland13-Sep-06 4:23
Zac Howland13-Sep-06 4:23 
GeneralRe: STL Algorithms Pin
Kevin McFarlane13-Sep-06 9:01
Kevin McFarlane13-Sep-06 9:01 
GeneralRe: STL Algorithms Pin
Zac Howland13-Sep-06 9:17
Zac Howland13-Sep-06 9:17 
AnswerRe: STL Algorithms Pin
Stephen Hewitt13-Sep-06 22:52
Stephen Hewitt13-Sep-06 22:52 
GeneralRe: STL Algorithms Pin
Rob Caldecott13-Sep-06 23:40
Rob Caldecott13-Sep-06 23:40 
GeneralRe: STL Algorithms Pin
Stuart Dootson14-Sep-06 1:17
professionalStuart Dootson14-Sep-06 1:17 
GeneralRe: STL Algorithms Pin
Zac Howland14-Sep-06 3:17
Zac Howland14-Sep-06 3:17 
GeneralRe: STL Algorithms Pin
Nemanja Trifunovic15-Sep-06 4:43
Nemanja Trifunovic15-Sep-06 4:43 
GeneralRe: STL Algorithms Pin
Zac Howland15-Sep-06 5:26
Zac Howland15-Sep-06 5:26 
GeneralRe: STL Algorithms Pin
Stuart Dootson15-Sep-06 5:43
professionalStuart Dootson15-Sep-06 5:43 
GeneralRe: STL Algorithms Pin
Rob Caldecott17-Sep-06 23:49
Rob Caldecott17-Sep-06 23:49 
GeneralRe: STL Algorithms Pin
Stephen Hewitt18-Sep-06 0:34
Stephen Hewitt18-Sep-06 0:34 
GeneralRe: STL Algorithms Pin
Rob Caldecott18-Sep-06 4:06
Rob Caldecott18-Sep-06 4:06 
GeneralRe: STL Algorithms Pin
Stephen Hewitt18-Sep-06 13:48
Stephen Hewitt18-Sep-06 13:48 
GeneralRe: STL Algorithms Pin
Rob Caldecott19-Sep-06 0:03
Rob Caldecott19-Sep-06 0:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.