here the fix: template<class _Ty> class InSequence : public std::binary_function<_Ty, const char*, bool> { public: bool operator()(const _Ty& _X, const char* _Y) const { return true; /* removed for brevity */ } };
>From: "Rolls, Robert" <[EMAIL PROTECTED]> >Reply-To: dotnet discussion <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: [DOTNET] OT: STL experts please I need some help! >Date: Wed, 17 Apr 2002 12:04:42 +1000 >MIME-Version: 1.0 >Received: from [63.111.243.44] by hotmail.com (3.2) with ESMTP id >MHotMailBE862A6B00C6400431E43F6FF32C057C0; Tue, 16 Apr 2002 19:36:25 -0700 >Received: from listserv3 (63.111.243.44) by listserv3.develop.com (LSMTP >for Windows NT v1.1b) with SMTP id <[EMAIL PROTECTED]>; Tue, >16 Apr 2002 19:34:55 -0700 >Received: from DISCUSS.DEVELOP.COM by DISCUSS.DEVELOP.COM (LISTSERV-TCP/IP > release 1.8d) with spool id 1967878 for >[EMAIL PROTECTED]; Tue, 16 Apr 2002 19:34:54 -0700 >Received: from citmsw1.vodafone.com.au (203.20.36.245) by >listserv3.develop.com (LSMTP for Windows NT v1.1b) with SMTP id > <[EMAIL PROTECTED]>; Tue, 16 Apr 2002 19:04:54 -0700 >Received: from cwd_exchange.vodafone.com.au (unverified) by >citmsw1.vodafone.com.au (Content Technologies SMTPRS 4.2.5) with >ESMTP id <[EMAIL PROTECTED]> for ><[EMAIL PROTECTED]>; Wed, 17 Apr 2002 12:07:09 +1000 >Received: by cwd_exchange.vodafone.com.au with Internet Mail Service > (5.5.2653.19) id <20JF8FMG>; Wed, 17 Apr 2002 12:04:49 +1000 >From [EMAIL PROTECTED] Tue, 16 Apr 2002 19:36:59 -0700 >X-Mailer: Internet Mail Service (5.5.2653.19) >Message-ID: ><[EMAIL PROTECTED]> >Sender: dotnet discussion <[EMAIL PROTECTED]> > >Hi all, > >I want to use replace_if to replace carrige return line feeds from a string >and I'm trying to set up a predicate here's what I've got - > >template<class _Ty> >class InSequence : public std::binary_function<_Ty, const char*, bool> { > bool operator()(const _Ty& _X, const char* _Y) { return true; /* >removed for brevity */ } >}; > > >std::string HitchHiker("So long and thanks for all the fish"); >std::replace_if( HitchHiker.begin(), HitchHiker.end(), std::bind2nd( >InSequence<char>(), "abc"), '$' ); > >but it don't compile - > >firstly what parameter should the template be _Ty ? and is this an optimal >solution? > > >Regards, >Robert Rolls > > > >**********************************************************************" >This correspondence is for the named person's use only. It may >contain confidential or legally privileged information or both. " >No confidentiality or privilege is waived or lost by any " >mistransmission. If you receive this correspondence in error, please >immediately delete it from your system and notify the sender. You >must not disclose, copy or rely on any part of this correspondence >if you are not the intended recipient. > >Any views expressed in this message are those of the individual sender, >except where the sender expressly, and with authority, states them to >be the views of Vodafone. > >This email has been checked for viruses. >********************************************************************************************** > >You can read messages from the DOTNET archive, unsubscribe from DOTNET, or >subscribe to other DevelopMentor lists at http://discuss.develop.com. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.