Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » C++

remove_copy

 
Jump to:  
 
gast128@hotmail.com
PostPosted: Sat Aug 30, 2008 3:28 pm    Post subject: remove_copy
       
Dear all,

it may be a friday afternoon issue, but I was looking for a remove
variant which removed elements from a vector, but not throwing them
away in the first place, but keeping a copy so that I still could do
things with the removed elements before actually destroy them.

So in the STL you have the 'remove(_if)' function which removes
elements. However the 'remove_copy' does not remove elements form the
original input! It has more the semantic of a 'copy_if_not' function
(also implicitly pointed out by Austern, by implementing 'copy_if' in
terms of 'remove_copy_if', see 12.6.4 of Generic Programming && STL).

Since the STL already exist for more than a decade, it must be my own
mind which interprets the function name wrong. Or it is indeed a
friday afternoon issue. Of course human language is multiple
interpretable and English is not my native language, so the original c+
+ committee members may be 'right' after all.

Above functionality is solvable btw by stable_partition as someone
pointed out in CUJ.

--
[ See LINK for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

przedłużanie włosów BRC gry i zabawy bet at home Toner Lexmark czarny