tag:blogger.com,1999:blog-2349434231090974738.post5022541318233530144..comments2023-10-24T19:15:52.177+01:00Comments on Advanced C++ with Examples: C++ example of 'transform'Zahid Ghadialyhttp://www.blogger.com/profile/11618208626682295272noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2349434231090974738.post-49984508742420125552010-04-15T08:59:53.991+01:002010-04-15T08:59:53.991+01:00I would rather split the above in two lines for si...I would rather split the above in two lines for simple reading:<br /><br />ostream_iterator out_it (cout," ");<br />copy( vectorOne.begin(), vectorOne.end(), out_it );<br /><br />But it makes the code less readable, especially for new starters.<br /><br />Also I am not sure if it gives any performance advantage.Zahid Ghadialyhttps://www.blogger.com/profile/11618208626682295272noreply@blogger.comtag:blogger.com,1999:blog-2349434231090974738.post-91220725076728370132010-04-14T20:32:04.187+01:002010-04-14T20:32:04.187+01:00Love this blog. Might I suggest for the output ab...Love this blog. Might I suggest for the output above that you use the following instead of the looping construct:<br /><br />std::copy( vectorOne.begin(), vectorOne.end(), std::ostream_iterator( std::cout, " " ) );Anonymoushttps://www.blogger.com/profile/03873470039583426925noreply@blogger.com