Click here to Skip to main content
15,908,906 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Windowless ActiveX control in WTL Pin
Jörgen Sigvardsson30-Dec-03 23:27
Jörgen Sigvardsson30-Dec-03 23:27 
GeneralRe: Windowless ActiveX control in WTL Pin
forjer31-Dec-03 2:53
forjer31-Dec-03 2:53 
GeneralRe: Windowless ActiveX control in WTL Pin
Jörgen Sigvardsson31-Dec-03 3:00
Jörgen Sigvardsson31-Dec-03 3:00 
GeneralPlease Explain This Pin
Prakash Nadar28-Dec-03 17:07
Prakash Nadar28-Dec-03 17:07 
GeneralRe: Please Explain This Pin
forjer29-Dec-03 7:46
forjer29-Dec-03 7:46 
GeneralRe: Please Explain This Pin
Prakash Nadar29-Dec-03 16:00
Prakash Nadar29-Dec-03 16:00 
GeneralSTL map. Pin
WREY28-Dec-03 13:57
WREY28-Dec-03 13:57 
GeneralRe: STL map. Pin
Anthony_Yio28-Dec-03 15:05
Anthony_Yio28-Dec-03 15:05 
check out STL algorithms. (use remove_if())

sample codes below.

using namespace std;

int main()
{
vector<int> coll;

INSERT_ELEMENTS(coll,2,6);
INSERT_ELEMENTS(coll,4,9);
INSERT_ELEMENTS(coll,1,7);
PRINT_ELEMENTS(coll,"coll: ");

//remove all elements with value 5
vector<int>::iterator pos;
pos = remove (coll. begin(), coll.end(), //range
5); //value to remove

PRINT_ELEMENTS(coll,"size not changed: ");

//erase the "removed" elements in the container
coll. erase (pos, coll.end());
PRINT_ELEMENTS(coll,"size changed: ");

//remove all elements less than 4
coll.erase(remove_if (coll.begin(), coll.end(), //range
bind2nd(less<int>(),4)), //remove criterion
coll.end());
PRINT_ELEMENTS(coll,"<4 removed: : ");
}



for replacing element in container. Use replace_copy_if(...)

BTW, my sample code is not using std::map but more or less the same I suppose.

Hope this helps.

Sonork 100.41263:Anthony_Yio
GeneralRe: STL map. Pin
WREY28-Dec-03 16:12
WREY28-Dec-03 16:12 
GeneralRe: STL map. Pin
Jörgen Sigvardsson29-Dec-03 12:39
Jörgen Sigvardsson29-Dec-03 12:39 
GeneralRe: STL map. Pin
Jörgen Sigvardsson29-Dec-03 11:31
Jörgen Sigvardsson29-Dec-03 11:31 
GeneralRe: STL map. Pin
WREY1-Jan-04 1:48
WREY1-Jan-04 1:48 
GeneralRe: STL map. Pin
Jörgen Sigvardsson1-Jan-04 5:01
Jörgen Sigvardsson1-Jan-04 5:01 
GeneralRe: STL map. Pin
WREY1-Jan-04 14:09
WREY1-Jan-04 14:09 
Questionstd::istrstream test(NULL) ... what happens??? Pin
Ralph Wetzel26-Dec-03 23:08
Ralph Wetzel26-Dec-03 23:08 
GeneralCom server terminates Pin
Prakash Nadar26-Dec-03 21:30
Prakash Nadar26-Dec-03 21:30 
GeneralPreformance issue Pin
lpRomang26-Dec-03 4:10
lpRomang26-Dec-03 4:10 
GeneralOLE DB templated samples Pin
Sebastián Benítez25-Dec-03 7:30
Sebastián Benítez25-Dec-03 7:30 
GeneralRe: OLE DB templated samples Pin
Igor Vigdorchik25-Dec-03 10:09
Igor Vigdorchik25-Dec-03 10:09 
GeneralRe: OLE DB templated samples Pin
Sebastián Benítez25-Dec-03 10:19
Sebastián Benítez25-Dec-03 10:19 
GeneralRe: OLE DB templated samples Pin
nativespirits29-Dec-03 14:24
nativespirits29-Dec-03 14:24 
GeneralWTL &quot;tendencies&quot; Pin
Shutter23-Dec-03 19:18
Shutter23-Dec-03 19:18 
GeneralRe: WTL &quot;tendencies&quot; Pin
Sebastián Benítez24-Dec-03 1:44
Sebastián Benítez24-Dec-03 1:44 
GeneralRe: WTL &quot;tendencies&quot; Pin
Shutter24-Dec-03 4:13
Shutter24-Dec-03 4:13 
GeneralRe: WTL &quot;tendencies&quot; Pin
Igor Vigdorchik24-Dec-03 8:48
Igor Vigdorchik24-Dec-03 8:48 

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.