Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Iterators in a subrange?

Reply
Thread Tools

Re: Iterators in a subrange?

 
 
tom_usenet
Guest
Posts: n/a
 
      07-01-2003
On Tue, 01 Jul 2003 12:57:48 GMT, http://www.velocityreviews.com/forums/(E-Mail Removed) (tom_usenet)
wrote:

>std::for_each(
> v.begin() + start,
> v.begin() + finis,
> std::bind2nd(
> std::mem_fun_ref(&X::sety),
> 1000
> )
>);


Ahh, that won't work unless you use the special <functional> header
from the boost library, because of binders taking a const reference
argument but setY being a non-const member function.

boost::bind would be better anyway:

std::for_each(
v.begin() + start,
v.begin() + finis,
boost::bind(
&X::sety,
_1,
1000
)
);

Tom
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
plain iterators and reverse iterators on vector subramanian100in@yahoo.com, India C++ 10 08-08-2009 08:28 AM
Iterators and reverse iterators Marcin Kaliciński C++ 1 05-08-2005 09:58 AM
Idempotent ODBMS iterators Paul Chapman Java 0 02-16-2005 01:51 PM
Nested iterators (well, not nested exactly...) Russ Perry Jr Java 2 08-20-2004 06:51 PM
Any interest in lightweight coroutines in Java ala C# 2.0 iterators? Ken Sprague Java 4 10-28-2003 08:03 PM



Advertisments